home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / avwyyt1a / source.bas < prev    next >
BASIC Source File  |  1999-09-12  |  80KB  |  2,727 lines

  1. Attribute VB_Name = "modFunctions"
  2. 'Source! Code
  3. 'By:  InfraRed
  4. 'Comments:  I hope you like my source code, if you
  5. 'notice anything that has been copied from other
  6. 'source code, then it must have been used in one
  7. 'of my applications which I copied all of this
  8. 'from directly.  This is all in sections plus with
  9. 'comments saying what the code does in every
  10. 'sub/function, for all of you newbies who want
  11. 'to learn lots of stuff fast.  Most of you who
  12. 'will use this source code probably will want to
  13. 'use it in some program you come up with.  Will
  14. 'you please give me a little credit if you do?
  15. 'I put in a lot of easy code, plus some harder
  16. 'source code.  Enjoy.
  17. 'Contacting Me:
  18. 'E-Mail:  InfraRed@flashmail.com
  19. 'ICQ:  17948286 (UIN)
  20.  
  21. '-------------------------------------------------------
  22.  
  23. 'Sub Titles of all source code in Source.bas:
  24.  
  25. 'Section 1 (Declarations):
  26. 'Global Declarations
  27. 'Other Declarations
  28.  
  29. 'Section 2:
  30. 'FileSave
  31. 'FileOpen
  32. 'ListSave
  33. 'ListOpen
  34.  
  35. 'Section 3:
  36. 'MakeDir
  37. 'DeleteDir
  38. 'DelFilesInDir
  39.  
  40. 'Section 4:
  41. 'MoveFile
  42. 'CopyFile
  43. 'DeleteFile
  44. 'ExecuteFile
  45.  
  46. 'Section 5:
  47. 'Encrypt
  48. 'Decrypt
  49. 'SuperEE (Private)
  50.  
  51. 'Section 6:
  52. 'DisableCtrlAltDel
  53. 'EnableCtrlAltDel
  54. 'HideCtrlAltDel
  55. 'ShowCtrlAltDel
  56.  
  57. 'Section 7:
  58. 'OpenCD
  59. 'CloseCD
  60. 'PrintBlankPage
  61. 'PrintText
  62. 'PrintPage
  63. 'PrintNewPage
  64. 'PrintEndOfLastPage
  65.  
  66. 'Section 8:
  67. 'MakeStartupReg
  68. 'AddToStartupDir
  69. 'MakeRegFile (Private)
  70.  
  71. 'Section 9:
  72. 'Ontop
  73. 'NotOntop
  74. 'InvisibleForm
  75.  
  76. 'Section 10:
  77. 'ClipboardCopy
  78. 'ClipboardGet
  79. 'ClearClipboard
  80.  
  81. 'Section 11:
  82. 'Ping
  83. 'ConvertIPAddressToLong (Private)
  84.  
  85. 'Section 12:
  86. 'Code1
  87. 'Code2
  88. 'Decode1
  89. 'Decode2
  90. 'ReplaceC (Private)
  91.  
  92. 'Section 13:
  93. 'Add
  94. 'Subtract
  95. 'Divide
  96. 'Multiply
  97. 'ToPower
  98. 'ToRoot
  99. 'FractionToDecimal
  100. 'DecimalToPercentage
  101. 'PercentageToDecimal
  102. 'AreaOfCircle
  103. 'Circumference
  104. 'AreaOfSquare
  105. 'PerimeterOfSquare
  106. 'PerimeterOfRectangle
  107. 'AreaOfRectangle
  108. 'AreaOfTriangle
  109. 'PerimeterOfTriangle
  110. 'PerimeterOf4SidedPolygon
  111. 'VolumeOfCube
  112. 'VolumeOfPrism
  113. 'VolumeOfSphere
  114. 'VolumeOfPyramid
  115. 'VolumeOfCone
  116. 'VolumeOfCylinder
  117.  
  118. 'Section 14:
  119. 'FadeThreeColorHTML
  120. 'FadeTwoColorHTML
  121. 'FadeThreeColorYahoo
  122. 'FadeTwoColorYahoo
  123. 'FadeThreeColorANSI
  124. 'FadeTwoColorANSI
  125.  
  126. 'Section 15:
  127. 'RestartWindows
  128. 'ExitWindows
  129. 'RebootComputer
  130.  
  131. 'Section 16:
  132. 'AltCaps
  133. 'BackwardsText
  134. 'EliteType
  135. 'SpaceCharacters
  136. 'DoubleCharacters
  137. 'EchoText
  138. 'Scramble
  139. 'TwistText
  140.  
  141. 'Section 17:
  142. 'GetAppVersion
  143. 'GetAppName
  144. 'GetAppPath
  145. 'GetAppDescription
  146. 'GetAppCopyRight
  147. 'GetAppComment
  148. 'GetAppTitle
  149. 'GetAppCompanyName
  150. 'GetAppProductName
  151.  
  152. 'Section 18:
  153. 'MoveMouse
  154. 'MousePosition
  155. 'LeftClick
  156. 'LeftDown
  157. 'LeftUp
  158. 'MiddleClick
  159. 'MiddleDown
  160. 'MiddleUp
  161. 'RightClick
  162. 'RightDown
  163. 'RightUp
  164.  
  165. 'Section 19:
  166. 'DrawSquareOnForm
  167. 'DrawLineOnForm
  168. 'DrawSquareOnPictureBox
  169. 'DrawLineOnPictureBox
  170.  
  171. 'Section 20:
  172. 'ConvertRGBToHex
  173. 'RGBToHex (Private)
  174. 'ConvertHexToRGB
  175. 'HexToRGB (Private)
  176. 'WebPage
  177. 'RandomNumber
  178. 'MakeInputBox
  179. 'LengthOfString
  180. 'FindAsciiOfChr
  181. 'MakeChrFromAscii
  182. 'MakeRndChrString
  183. 'DoSendKeys
  184. 'GetTextFromListBox
  185. 'GetTextFromComboBox
  186. 'PasswordLock
  187. 'ChangeDefaultDir
  188. 'ChangeDefaultDrive
  189. 'MakeRegistrySetting
  190.  
  191. '-------------------------------------------------------
  192.  
  193. 'Section 1:  Declarations
  194.  
  195. 'Global Declarations
  196. Global MouseDown As Boolean
  197. Global MouseOver As Boolean
  198. Global Mouse As New CMouse
  199. Global s(52) As String
  200. Global pi As Long
  201. Global NumLinesOnPageToPrint As Integer
  202. Global FirstPageNum As Integer
  203. Global NextPageNum As Integer
  204. Global LineNum As Integer
  205. Global CheckThisLineNum As Integer
  206. Global NumLines As Integer
  207. Global TotalPageCount As Integer
  208.  
  209. 'Other Declarations
  210. Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
  211. Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
  212. Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  213. Public Const MOUSEEVENTF_LEFTDOWN = &H2
  214. Public Const MOUSEEVENTF_LEFTUP = &H4
  215. Public Const MOUSEEVENTF_MIDDLEDOWN = &H20
  216. Public Const MOUSEEVENTF_MIDDLEUP = &H40
  217. Public Const MOUSEEVENTF_RIGHTDOWN = &H8
  218. Public Const MOUSEEVENTF_RIGHTUP = &H10
  219. Public Const MOUSEEVENTF_MOVE = &H1
  220. Declare Function ShowCursor& Lib "user32" (ByVal bShow As Long)
  221. Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
  222. Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
  223. Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
  224. Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  225. Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
  226. Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
  227. Public Const RGN_AND = 1
  228. Public Const RGN_COPY = 5
  229. Public Const RGN_DIFF = 4
  230. Public Const RGN_OR = 2
  231. Public Const RGN_XOR = 3
  232. Type POINTAPI
  233. X As Long
  234. Y As Long
  235. End Type
  236. Type RECT
  237. Left As Long
  238. Top As Long
  239. Right As Long
  240. Bottom As Long
  241. End Type
  242. Declare Function ExitWindows Lib "User" (ByVal dwReturnCode As Long, ByVal uReserved As Integer) As Integer
  243. Global Const EW_REBOOTSYSTEM = &H43
  244. Global Const EW_RESTARTWINDOWS = &H42
  245. Global Const EW_EXITWINDOWS = 0
  246. Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  247. Public Const HWND_NOTOPMOST = -2
  248. Public Const HWND_TOPMOST = -1
  249. Public Const SWP_NOMOVE = &H2
  250. Public Const SWP_NOSIZE = &H1
  251. Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  252. Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
  253. Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
  254. Private Const SPI_SCREENSAVERRUNNING = 97
  255. Type SECURITY_ATTRIBUTES
  256. nLength As Long
  257. lpSecurityDescriptor As Long
  258. bInheritHandle As Boolean
  259. End Type
  260. Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal szData As String, ByVal cbData As Long) As Long
  261. Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  262. Declare Function RegCreateKeyEx Lib "advapi32" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition As Long) As Long
  263. Private Const IP_STATUS_BASE = 11000
  264. Private Const IP_SUCCESS = 0
  265. Private Const IP_BUF_TOO_SMALL = (11000 + 1)
  266. Private Const IP_DEST_NET_UNREACHABLE = (11000 + 2)
  267. Private Const IP_DEST_HOST_UNREACHABLE = (11000 + 3)
  268. Private Const IP_DEST_PROT_UNREACHABLE = (11000 + 4)
  269. Private Const IP_DEST_PORT_UNREACHABLE = (11000 + 5)
  270. Private Const IP_NO_RESOURCES = (11000 + 6)
  271. Private Const IP_BAD_OPTION = (11000 + 7)
  272. Private Const IP_HW_ERROR = (11000 + 8)
  273. Private Const IP_PACKET_TOO_BIG = (11000 + 9)
  274. Private Const IP_REQ_TIMED_OUT = (11000 + 10)
  275. Private Const IP_BAD_REQ = (11000 + 11)
  276. Private Const IP_BAD_ROUTE = (11000 + 12)
  277. Private Const IP_TTL_EXPIRED_TRANSIT = (11000 + 13)
  278. Private Const IP_TTL_EXPIRED_REASSEM = (11000 + 14)
  279. Private Const IP_PARAM_PROBLEM = (11000 + 15)
  280. Private Const IP_SOURCE_QUENCH = (11000 + 16)
  281. Private Const IP_OPTION_TOO_BIG = (11000 + 17)
  282. Private Const IP_BAD_DESTINATION = (11000 + 18)
  283. Private Const IP_ADDR_DELETED = (11000 + 19)
  284. Private Const IP_SPEC_MTU_CHANGE = (11000 + 20)
  285. Private Const IP_MTU_CHANGE = (11000 + 21)
  286. Private Const IP_UNLOAD = (11000 + 22)
  287. Private Const IP_ADDR_ADDED = (11000 + 23)
  288. Private Const IP_GENERAL_FAILURE = (11000 + 50)
  289. Private Const MAX_IP_STATUS = 11000 + 50
  290. Private Const IP_PENDING = (11000 + 255)
  291. Private Type ip_option_information
  292. Ttl             As Byte
  293. Tos             As Byte
  294. FLAGS           As Byte
  295. OptionsSize     As Byte
  296. OptionsData     As Long
  297. End Type
  298. Private Type icmp_echo_reply
  299. Address         As Long
  300. Status          As Long
  301. RoundTripTime   As Long
  302. DataSize        As Integer
  303. Reserved        As Integer
  304. DataPointer     As Long
  305. Options         As ip_option_information
  306. Data            As String * 250
  307. End Type
  308. Private Declare Function IcmpCreateFile Lib "icmp.dll" () As Long
  309. Private Declare Function IcmpCloseHandle Lib "icmp.dll" (ByVal IcmpHandle As Long) As Long
  310. Private Declare Function IcmpSendEcho Lib "icmp.dll" (ByVal IcmpHandle As Long, _
  311.                                                     ByVal DestinationAddress As Long, _
  312.                                                     ByVal RequestData As String, _
  313.                                                     ByVal RequestSize As Integer, _
  314.                                                     RequestOptions As ip_option_information, _
  315.                                                     ReplyBuffer As icmp_echo_reply, _
  316.                                                     ByVal ReplySize As Long, _
  317.                                                     ByVal TimeOut As Long) As Long
  318. Private Const PING_TIMEOUT = 200
  319. Private Const WSADESCRIPTION_LEN = 256
  320. Private Const WSASYSSTATUS_LEN = 256
  321. Private Const WSADESCRIPTION_LEN_1 = WSADESCRIPTION_LEN + 1
  322. Private Const WSASYSSTATUS_LEN_1 = WSASYSSTATUS_LEN + 1
  323. Private Const SOCKET_ERROR = -1
  324. Private Type tagWSAData
  325. wVersion            As Integer
  326. wHighVersion        As Integer
  327. szDescription       As String * WSADESCRIPTION_LEN_1
  328. szSystemStatus      As String * WSASYSSTATUS_LEN_1
  329. iMaxSockets         As Integer
  330. iMaxUdpDg           As Integer
  331. lpVendorInfo        As String * 200
  332. End Type
  333. Private Declare Function WSAStartup Lib "wsock32" (ByVal wVersionRequested As Integer, lpWSAData As tagWSAData) As Integer
  334. Private Declare Function WSACleanup Lib "wsock32" () As Integer
  335.  
  336. 'Section 2:  Saving/Opening Files
  337.  
  338. Public Sub FileSave(text As String, FilePath As String)
  339. 'Save a text file
  340. On Error GoTo error
  341. Dim Directory As String
  342.               Directory$ = FilePath
  343.        On Error GoTo error
  344.        Open Directory$ For Output As #1
  345.            Print #1, text
  346.        Close #1
  347. Exit Sub
  348. error:  MsgBox Err.Description, vbExclamation, "Error"
  349. End Sub
  350.  
  351. Function FileOpen(FilePath As String)
  352. 'Open a text file
  353. On Error GoTo error
  354. Dim Directory As String
  355. Directory$ = FilePath
  356.     Dim MyString As String
  357.        On Error GoTo error
  358.        Open Directory$ For Input As #1
  359.        While Not EOF(1)
  360.            Input #1, FileOpen
  361.            Wend
  362.            Close #1
  363. Exit Function
  364. error:  MsgBox Err.Description, vbExclamation, "Error"
  365. End Function
  366.  
  367. Public Sub ListSave(List As ListBox, FilePath As String)
  368. 'Save all data in a list box
  369. On Error GoTo error
  370. Dim i As Integer
  371. Dim Directory As String
  372.               Directory$ = FilePath
  373.        On Error GoTo error
  374.        Open Directory$ For Output As #1
  375.        For i = 0 To List.ListCount - 1
  376.            Print #1, List.List(i)
  377.        Next i
  378.        Close #1
  379. Exit Sub
  380. error:  MsgBox Err.Description, vbExclamation, "Error"
  381. End Sub
  382.  
  383. Public Sub ListOpen(List As ListBox, FilePath As String)
  384. 'Open saved list box data
  385. On Error GoTo error
  386. Directory$ = FilePath
  387.     Dim MyString As String
  388.        On Error GoTo error
  389.        Open Directory$ For Input As #1
  390.        While Not EOF(1)
  391.            Input #1, MyString$
  392.            DoEvents
  393.                List.AddItem MyString$
  394.            Wend
  395.            Close #1
  396. Exit Sub
  397. error:  MsgBox Err.Description, vbExclamation, "Error"
  398. End Sub
  399.  
  400. 'Section 3:  Deleting/Making Directories
  401.  
  402. Public Sub MakeDir(DirPath As String)
  403. 'Make a directory
  404. On Error GoTo error
  405. MkDir DirPath$
  406. Exit Sub
  407. error:  MsgBox Err.Description, vbExclamation, "Error"
  408. End Sub
  409.  
  410. Public Sub DeleteDir(DirPath As String)
  411. 'Delete a directory
  412. On Error GoTo error
  413. RmDir DirPath$
  414. Exit Sub
  415. error:  MsgBox Err.Description, vbExclamation, "Error"
  416. End Sub
  417.  
  418. Public Sub DelFilesInDir(DirPath As String, DelDir As Boolean)
  419. 'Delete all files in a directory and (optional) delete the directory too
  420. On Error GoTo error
  421. Kill DirPath$ & "*.*"
  422. If DelDir = True Then
  423. RmDir DirPath$
  424. End If
  425. Exit Sub
  426. error:  MsgBox Err.Description, vbExclamation, "Error"
  427. End Sub
  428.  
  429. 'Section 4:  Copying/Moving/Executing/Deleting Files
  430.  
  431. Public Sub MoveFile(StartPath As String, EndPath As String)
  432. 'Move a file
  433. On Error GoTo error
  434. FileCopy StartPath$, EndPath$
  435. Kill StartPath$
  436. Exit Sub
  437. error:  MsgBox Err.Description, vbExclamation, "Error"
  438. End Sub
  439.  
  440. Public Sub CopyFile(StartPath As String, EndPath As String)
  441. 'Copy a file
  442. On Error GoTo error
  443. FileCopy StartPath$, EndPath$
  444. Exit Sub
  445. error:  MsgBox Err.Description, vbExclamation, "Error"
  446. End Sub
  447.  
  448. Public Sub DeleteFile(FilePath As String)
  449. 'Delete a file
  450. On Error GoTo error
  451. Kill FilePath$
  452. Exit Sub
  453. error:  MsgBox Err.Description, vbExclamation, "Error"
  454. End Sub
  455.  
  456. Public Sub ExecuteFile(FilePath As String)
  457. 'Execute a file
  458. On Error GoTo error
  459. ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & (FilePath))
  460. Exit Sub
  461. error:  MsgBox Err.Description, vbExclamation, "Error"
  462. End Sub
  463.  
  464. 'Section 5:  Encryption/Decryption
  465.  
  466. Function Encrypt(Start As Integer, diff As Integer, beta As Integer, alpha As Integer, times As Integer, SuperEncrypt As Boolean, text As String)
  467. 'Encrypt characters
  468. On Error GoTo error
  469. Dim i As Integer
  470. Dim curkey As Long
  471. Dim m As Long
  472. Dim endstr As String
  473. Dim Text2 As String
  474. Dim lesser As Double
  475. Dim larger As Double
  476. Dim SuperE As Boolean
  477. Dim a As Integer
  478. SuperE = SuperEncrypt
  479. If diff > 500 Then
  480. diff = 500
  481. ElseIf diff < 1 Then
  482. diff = 1
  483. End If
  484. If times > 100 Then
  485. times = 100
  486. ElseIf times < 1 Then
  487. times = 1
  488. End If
  489. If Start > 255 Then
  490. Start = 255
  491. ElseIf Start < 1 Then
  492. Start = 1
  493. End If
  494. If beta > 5 Then
  495. beta = 5
  496. ElseIf beta < 1 Then
  497. beta = 1
  498. End If
  499. If alpha > 5 Then
  500. alpha = 5
  501. ElseIf alpha < 1 Then
  502. alpha = 1
  503. End If
  504. curkey = Start
  505. curkey = (curkey * alpha) / beta
  506.   If SuperE = True Then
  507.     If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  508.     curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  509.     Else
  510.     curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  511.     End If
  512.   curkey = SuperEE(curkey, beta, alpha, beta)
  513.   End If
  514.   If curkey > 255 Then
  515.   curkey = 255 - (curkey / 255)
  516.   ElseIf curkey < 0 Then
  517.   curkey = 0 - (curkey / 255)
  518.   End If
  519. For a = 1 To times
  520. For i = 1 To Len(text)
  521.     If 255 - curkey > curkey Then
  522.     larger = 255 - curkey
  523.     lesser = curkey
  524.     Else
  525.     larger = curkey
  526.     lesser = 255 - curkey
  527.     End If
  528.   If Asc(Mid$(text, i, 1)) <= lesser Then
  529.   m = Asc(Mid$(text, i, 1)) + (larger - 1)
  530.   endstr = endstr + Chr$(m)
  531.   Else
  532.   m = Asc(Mid$(text, i, 1)) - lesser
  533.   endstr = endstr + Chr$(m)
  534.   End If
  535. curkey = curkey + diff
  536.   If curkey > 255 Then
  537.   curkey = curkey - 255
  538.   End If
  539. curkey = (curkey * alpha) / beta
  540.   If SuperE = True Then
  541.     If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  542.     curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  543.     Else
  544.     curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  545.     End If
  546.   curkey = SuperEE(curkey, beta, alpha, beta)
  547.   End If
  548. beta = beta + (2 * diff)
  549. alpha = alpha + diff
  550.   If beta > 5 Then
  551.   beta = 1
  552.   End If
  553.   If alpha > 5 Then
  554.   alpha = 1
  555.   End If
  556.   If curkey > 255 Then
  557.   curkey = 255 - (curkey / 255)
  558.   ElseIf curkey < 0 Then
  559.   curkey = 0 - (curkey / 255)
  560.   End If
  561.   If diff > 500 Then
  562.   diff = 1
  563.   Else
  564.   diff = diff + diff
  565.   End If
  566. Next i
  567. Text2 = ""
  568. Text2 = endstr
  569. endstr = ""
  570. Next a
  571. Encrypt = Text2
  572. Exit Function
  573. error:  MsgBox Err.Description, vbExclamation, "Error"
  574. End Function
  575.  
  576. Function Decrypt(Start As Integer, diff As Integer, beta As Integer, alpha As Integer, times As Integer, SuperEncrypt As Boolean, text As String)
  577. 'Decrypt characters
  578. On Error GoTo error
  579. Dim i As Integer
  580. Dim curkey As Long
  581. Dim m As Long
  582. Dim endstr As String
  583. Dim Text2 As String
  584. Dim lesser As Double
  585. Dim larger As Double
  586. Dim SuperE As Boolean
  587. Dim a As Integer
  588. SuperE = SuperEncrypt
  589. If diff > 500 Then
  590. diff = 500
  591. ElseIf diff < 1 Then
  592. diff = 1
  593. End If
  594. If times > 100 Then
  595. times = 100
  596. ElseIf times < 1 Then
  597. times = 1
  598. End If
  599. If Start > 255 Then
  600. Start = 255
  601. ElseIf Start < 1 Then
  602. Start = 1
  603. End If
  604. If beta > 5 Then
  605. beta = 5
  606. ElseIf beta < 1 Then
  607. beta = 1
  608. End If
  609. If alpha > 5 Then
  610. alpha = 5
  611. ElseIf alpha < 1 Then
  612. alpha = 1
  613. End If
  614. curkey = Start
  615. curkey = (curkey * alpha) / beta
  616.   If SuperE = True Then
  617.     If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  618.     curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  619.     Else
  620.     curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  621.     End If
  622.   curkey = SuperEE(curkey, beta, alpha, beta)
  623.   End If
  624.   If curkey > 255 Then
  625.   curkey = 255 - (curkey / 255)
  626.   ElseIf curkey < 0 Then
  627.   curkey = 0 - (curkey / 255)
  628.   End If
  629. For a = 1 To times
  630. For i = 1 To Len(text)
  631.     If 255 - curkey > curkey Then
  632.     larger = 255 - curkey
  633.     lesser = curkey
  634.     Else
  635.     larger = curkey
  636.     lesser = 255 - curkey
  637.     End If
  638.   If Asc(Mid$(text, i, 1)) >= larger Then
  639.   m = Asc(Mid$(text, i, 1)) - (larger - 1)
  640.   endstr = endstr + Chr$(m)
  641.   Else
  642.   m = Asc(Mid$(text, i, 1)) + lesser
  643.   endstr = endstr + Chr$(m)
  644.   End If
  645. curkey = curkey + diff
  646.   If curkey > 255 Then
  647.   curkey = curkey - 255
  648.   End If
  649. curkey = (curkey * alpha) / beta
  650.   If SuperE = True Then
  651.     If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  652.     curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  653.     Else
  654.     curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  655.     End If
  656.   curkey = SuperEE(curkey, beta, alpha, beta)
  657.   End If
  658. beta = beta + (2 * diff)
  659. alpha = alpha + diff
  660.   If beta > 5 Then
  661.   beta = 1
  662.   End If
  663.   If alpha > 5 Then
  664.   alpha = 1
  665.   End If
  666.   If curkey > 255 Then
  667.   curkey = 255 - (curkey / 255)
  668.   ElseIf curkey < 0 Then
  669.   curkey = 0 - (curkey / 255)
  670.   End If
  671.   If diff > 500 Then
  672.   diff = 1
  673.   Else
  674.   diff = diff + diff
  675.   End If
  676. Next i
  677. Text2 = ""
  678. Text2 = endstr
  679. endstr = ""
  680. Next a
  681. Decrypt = Text2
  682. Exit Function
  683. error:  MsgBox Err.Description, vbExclamation, "Error"
  684. End Function
  685.  
  686. Private Function SuperEE(curkey As Long, beta As Integer, alpha As Integer, times As Integer)
  687. 'For encryption:  Change the current key around more
  688. On Error GoTo error
  689. curkey = (((curkey / times) - (beta + times)) * alpha) + ((beta / alpha) - times)
  690. If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  691. curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  692. Else
  693. curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  694. End If
  695. If beta - times = 0 Then
  696. curkey = ((curkey * alpha) + (beta * times))
  697. Else
  698. curkey = ((curkey * (beta - times)) + (beta - times))
  699.   If curkey < 0 Then
  700.   curkey = curkey + (alpha + beta)
  701.   ElseIf curkey = 0 Then
  702.   curkey = curkey + (alpha + times)
  703.   Else
  704.   curkey = curkey + (beta + times)
  705.   End If
  706. End If
  707. SuperEE = curkey
  708. Exit Function
  709. error:  MsgBox Err.Description, vbExclamation, "Error"
  710. End Function
  711.  
  712. 'Section 6:  Ctrl + Alt + Del Stuff
  713.  
  714. Public Sub DisableCtrlAltDel()
  715. 'Disable Ctrl + Alt + Del
  716. On Error GoTo error
  717. Dim ret As Integer
  718. Dim pOld As Boolean
  719. ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
  720. Exit Sub
  721. error:  MsgBox Err.Description, vbExclamation, "Error"
  722. End Sub
  723.  
  724. Public Sub EnableCtrlAltDel()
  725. 'Enable Ctrl + Alt + Del
  726. On Error GoTo error
  727. Dim ret As Integer
  728. Dim pOld As Boolean
  729. ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
  730. Exit Sub
  731. error:  MsgBox Err.Description, vbExclamation, "Error"
  732. End Sub
  733.  
  734. Public Sub HideCtrlAltDel()
  735. 'Hide this app from Ctrl + Alt + Del
  736. On Error GoTo error
  737. App.TaskVisible = False
  738. Exit Sub
  739. error:  MsgBox Err.Description, vbExclamation, "Error"
  740. End Sub
  741.  
  742. Public Sub ShowCtrlAltDel()
  743. 'Show this app in Ctrl + Alt + Del
  744. On Error GoTo error
  745. App.TaskVisible = True
  746. Exit Sub
  747. error:  MsgBox Err.Description, vbExclamation, "Error"
  748. End Sub
  749.  
  750. 'Section 7:  External Stuff (Printer/CD)
  751.  
  752. Public Sub OpenCD()
  753. 'Open the CD drive
  754. On Error GoTo error
  755. retvalue = mciSendString("set CDAudio door open", returnstring, 127, 0)
  756. Exit Sub
  757. error:  MsgBox Err.Description, vbExclamation, "Error"
  758. End Sub
  759.  
  760. Public Sub CloseCD()
  761. 'Close the CD drive
  762. On Error GoTo error
  763. retvalue = mciSendString("set CDAudio door closed", returnstring, 127, 0)
  764. Exit Sub
  765. error:  MsgBox Err.Description, vbExclamation, "Error"
  766. End Sub
  767.  
  768. Public Sub PrintBlankPage()
  769. 'Print a blank page out of a printer
  770. On Error GoTo error
  771. Printer.NewPage
  772. Exit Sub
  773. error:  MsgBox Err.Description, vbExclamation, "Error"
  774. End Sub
  775.  
  776. Public Sub PrintText(text As String, MarginSize As Integer, AmountOfChrsInOneLine As Integer, JustUseDefault As Boolean)
  777. 'This will print the text out of the default printer
  778. On Error Resume Next
  779. Screen.MousePointer = 11
  780. If JustUseDefault = True Then
  781. MarginSize = 10
  782. AmountOfChrsInOneLine = 65
  783. End If
  784. NumLinesOnPageToPrint = 60
  785. If NextPageNum% > 0 Then NextPageNum% = 0
  786. NextPageNum% = FirstPageNum% + NextPageNum% + 1
  787. TotalPageCount% = 1
  788. Call PrintPage(text$, MarginSize, AmountOfChrsInOneLine)
  789. PrintEndOfLastPage
  790. Screen.MousePointer = 0
  791. Exit Sub
  792. error:  MsgBox Err.Description, vbExclamation, "Error"
  793. End Sub
  794.  
  795. Private Sub PrintPage(TextString, Margin As Integer, Length_ChrsInlineOfText As Integer)
  796. 'For Print Text:  This will print a page of the text out of the printer
  797. On Error Resume Next
  798. Dim ChrPosition
  799. Dim AllChrsInThisLineOfText
  800. Dim PlaceInLineOfText As Integer
  801. ChrPosition = 1
  802. Printer.FontSize = 18
  803. Printer.Print Tab(MarginSize%);
  804. LineNum% = 1
  805. Do While ChrPosition < Len(TextString)
  806. AllChrsInThisLineOfText = Mid$(TextString, ChrPosition, Length_ChrsInlineOfText%)
  807. If ChrPosition + Len(AllChrsInThisLineOfText) < Len(TextString) Then
  808. For PlaceInLineOfText% = Len(AllChrsInThisLineOfText) To 1 Step -1
  809. If Mid$(AllChrsInThisLineOfText, PlaceInLineOfText%, 1) = Chr$(32) Then
  810. CheckThisLineNum% = 1
  811. PrintNewPage
  812. If InStr(1, AllChrsInThisLineOfText, Chr$(10), 1) > 0 Then
  813. CheckThisLineNum% = 1
  814. PrintNewPage
  815. PlaceInLineOfText% = InStr(1, AllChrsInThisLineOfText, Chr$(10), 1)
  816. LineNum% = LineNum% + 1
  817. End If
  818. If Mid$(TextString, ChrPosition, PlaceInLineOfText%) <> Chr$(13) + Chr$(10) Then
  819. Printer.Print Tab(MarginSize%);
  820. Printer.Print Mid$(TextString, ChrPosition, PlaceInLineOfText%)
  821. LineNum% = LineNum% + 1
  822. Else
  823. LineNum% = LineNum% - 1
  824. End If
  825. ChrPosition = ChrPosition + PlaceInLineOfText%
  826. PlaceInLineOfText% = 0
  827. End If
  828. Next
  829. Else
  830. CheckThisLineNum% = 1
  831. PrintNewPage
  832. Printer.Print Tab(Margin%);
  833. Printer.Print AllChrsInThisLineOfText
  834. ChrPosition = Len(TextString)
  835. LineNum% = LineNum% + 1
  836. End If
  837. Loop
  838. Exit Sub
  839. error:  MsgBox Err.Description, vbExclamation, "Error"
  840. End Sub
  841.  
  842. Private Sub PrintNewPage()
  843. 'For Print Text:  This will begin a new page to print the text out of the printer
  844. On Error Resume Next
  845. If LineNum% + CheckThisLineNum% >= NumLinesOnPageToPrint% Then
  846. Printer.Print ""
  847. Printer.Print Tab(MarginSize%);
  848. Printer.Print "(continued on page " + CStr(NextPageNum%) + ")"
  849. Printer.NewPage
  850. TotalPageCount% = TotalPageCount% + 1
  851. Printer.Print Tab(MarginSize%);
  852. Printer.Print "Page " + CStr(NextPageNum%)
  853. Printer.Print ""
  854. Printer.Print ""
  855. NextPageNum% = NextPageNum% + 1
  856. LineNum% = 3
  857. End If
  858. CheckThisLineNum% = 0
  859. Exit Sub
  860. error:  MsgBox Err.Description, vbExclamation, "Error"
  861. End Sub
  862.  
  863. Private Sub PrintEndOfLastPage()
  864. 'For Print Text:  This will print the end of the last page out of the printer
  865. On Error Resume Next
  866. If LineNum% + 2 > NumLinesOnPageToPrint% Then
  867. Printer.NewPage
  868. TotalPageCount% = TotalPageCount% + 1
  869. Printer.Print Tab(MarginSize%);
  870. Printer.Print "Page " + CStr(NextPageNum%)
  871. Printer.Print ""
  872. Printer.Print ""
  873. Printer.Print Tab(MarginSize%);
  874. Else
  875. Printer.Print ""
  876. Printer.Print Tab(MarginSize%);
  877. End If
  878. Printer.EndDoc
  879. Exit Sub
  880. error:  MsgBox Err.Description, vbExclamation, "Error"
  881. End Sub
  882.  
  883. 'Section 8:  Startup
  884.  
  885. Public Sub MakeStartupReg(AppTitle As String)
  886. 'Add your application to windows startup registry
  887. On Error GoTo error
  888. a = MakeRegFile(&H80000002, "SOFTWARE\Microsoft\Windows\CurrentVersion\Run", AppTitle$, App.Path & "\" & App.EXEName & ".exe")
  889. Exit Sub
  890. error:  MsgBox Err.Description, vbExclamation, "Error"
  891. End Sub
  892.  
  893. Public Sub AddToStartupDir()
  894. 'Add your application to the windows startup folder
  895. On Error GoTo error
  896. FileCopy App.Path & "\" & App.EXEName & ".EXE", Mid$(App.Path, 1, 3) & "WINDOWS\START MENU\PROGRAMS\STARTUP\" & App.EXEName & ".EXE"
  897. Exit Sub
  898. error:  MsgBox Err.Description, vbExclamation, "Error"
  899. End Sub
  900.  
  901. Private Function MakeRegFile(ByVal hKey As Long, ByVal lpszSubKey As String, ByVal sSetValue As String, ByVal sValue As String) As Boolean
  902. 'For make startup and make registry setting:  Makes the registry setting
  903. On Error GoTo error
  904. Dim phkResult As Long
  905. Dim lResult As Long
  906. Dim SA As SECURITY_ATTRIBUTES
  907. Dim lCreate As Long
  908. RegCreateKeyEx hKey, lpszSubKey, 0, "", REG_OPTION_NON_VOLATILE, _
  909. KEY_ALL_ACCESS, SA, phkResult, lCreate
  910. lResult = RegSetValueEx(phkResult, sSetValue, 0, 1, sValue, _
  911. CLng(Len(sValue) + 1))
  912. RegCloseKey phkResult
  913. MakeRegFile = (lResult = ERROR_SUCCESS)
  914. Exit Function
  915. error:
  916. MakeRegFile = False
  917. End Function
  918.  
  919. Public Sub ExecuteNewProgram()
  920. 'This will execute the program over again, creating two working copies
  921. On Error GoTo error
  922. ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & App.Path & "\" & App.EXEName & ".EXE")
  923. Exit Sub
  924. error:  MsgBox Err.Description, vbExclamation, "Error"
  925. End Sub
  926.  
  927. 'Section 9:  Form Stuff
  928.  
  929. Public Sub Ontop(FormName As Form)
  930. 'Make a form always ontop of other windows
  931. On Error GoTo error
  932. Call SetWindowPos(FormName.hwnd, HWND_TOPMOST, 0&, 0&, 0&, 0&, FLAGS)
  933. Exit Sub
  934. error:  MsgBox Err.Description, vbExclamation, "Error"
  935. End Sub
  936.  
  937. Public Sub NotOnTop(FormName As Form)
  938. 'Make a form not always ontop of other windows
  939. On Error GoTo error
  940. Call SetWindowPos(FormName.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, FLAGS)
  941. Exit Sub
  942. error:  MsgBox Err.Description, vbExclamation, "Error"
  943. End Sub
  944.  
  945. Public Sub InvisibleForm(frm As Form)
  946. 'Make a form invisible
  947. On Error GoTo error
  948. Dim rctClient As RECT, rctFrame As RECT
  949. Dim hClient As Long, hFrame As Long
  950. GetWindowRect frm.hwnd, rctFrame
  951. GetClientRect frm.hwnd, rctClient
  952. Dim lpTL As POINTAPI, lpBR As POINTAPI
  953. lpTL.X = rctFrame.Left
  954. lpTL.Y = rctFrame.Top
  955. lpBR.X = rctFrame.Right
  956. lpBR.Y = rctFrame.Bottom
  957. ScreenToClient frm.hwnd, lpTL
  958. ScreenToClient frm.hwnd, lpBR
  959. rctFrame.Left = lpTL.X
  960. rctFrame.Top = lpTL.Y
  961. rctFrame.Right = lpBR.X
  962. rctFrame.Bottom = lpBR.Y
  963. rctClient.Left = Abs(rctFrame.Left)
  964. rctClient.Top = Abs(rctFrame.Top)
  965. rctClient.Right = rctClient.Right + Abs(rctFrame.Left)
  966. rctClient.Bottom = rctClient.Bottom + Abs(rctFrame.Top)
  967. rctFrame.Right = rctFrame.Right + Abs(rctFrame.Left)
  968. rctFrame.Bottom = rctFrame.Bottom + Abs(rctFrame.Top)
  969. rctFrame.Top = 0
  970. rctFrame.Left = 0
  971. hClient = CreateRectRgn(rctClient.Left, rctClient.Top, rctClient.Right, rctClient.Bottom)
  972. hFrame = CreateRectRgn(rctFrame.Left, rctFrame.Top, rctFrame.Right, rctFrame.Bottom)
  973. CombineRgn hFrame, hClient, hFrame, RGN_XOR
  974. SetWindowRgn frm.hwnd, hFrame, True
  975. Exit Sub
  976. error:  MsgBox Err.Description, vbExclamation, "Error"
  977. End Sub
  978.  
  979. 'Section 10:  Clipboard Stuff
  980.  
  981. Public Sub ClipboardCopy(text As String)
  982. 'Copies text to the clipboard
  983. On Error GoTo error
  984. Clipboard.Clear
  985. Clipboard.SetText text$
  986. Exit Sub
  987. error:  MsgBox Err.Description, vbExclamation, "Error"
  988. End Sub
  989.  
  990. Function ClipboardGet()
  991. 'Gets the copied text from the clipboard
  992. On Error GoTo error
  993. ClipboardGet = Clipboard.GetText
  994. Exit Sub
  995. error:  MsgBox Err.Description, vbExclamation, "Error"
  996. End Function
  997.  
  998. Public Sub ClearClipboard()
  999. 'Clears the clipboard
  1000. On Error GoTo error
  1001. Clipboard.Clear
  1002. Exit Sub
  1003. error:  MsgBox Err.Description, vbExclamation, "Error"
  1004. End Sub
  1005.  
  1006. 'Section 11:  Ping
  1007.  
  1008. Public Sub Ping(message As String, IPAddress As String)
  1009. 'Ping an IP Address
  1010. On Error GoTo error
  1011.     Dim hFile       As Long
  1012.     Dim lRet        As Long
  1013.     Dim lIPAddress  As Long
  1014.     Dim strMessage  As String
  1015.     Dim pOptions    As ip_option_information
  1016.     Dim pReturn     As icmp_echo_reply
  1017.     Dim iVal        As Integer
  1018.     Dim lPingRet    As Long
  1019.     Dim pWsaData    As tagWSAData
  1020.     strMessage = message$
  1021.     iVal = WSAStartup(&H101, pWsaData)
  1022.     lIPAddress = ConvertIPAddressToLong(IPAddress$)
  1023.     hFile = IcmpCreateFile()
  1024.     pOptions.Ttl = 30
  1025.     pOptions.Tos = 12
  1026.     pWsaData.wVersion = 4
  1027.     lRet = IcmpSendEcho(hFile, _
  1028.                         lIPAddress, _
  1029.                         strMessage, _
  1030.                         Len(strMessage), _
  1031.                         pOptions, _
  1032.                         pReturn, _
  1033.                         Len(pReturn), _
  1034.                         PING_TIMEOUT)
  1035.  
  1036.     If lRet = 0 Then
  1037.     Else
  1038.         If pReturn.Status <> 0 Then
  1039.         Else
  1040.             lRet = IcmpCloseHandle(hFile)
  1041.             iVal = WSACleanup()
  1042.             Exit Sub
  1043.         End If
  1044.     End If
  1045. lRet = IcmpCloseHandle(hFile)
  1046. iVal = WSACleanup()
  1047. Exit Sub
  1048. error:  MsgBox Err.Description, vbExclamation, "Error"
  1049. End Sub
  1050.  
  1051. Private Function ConvertIPAddressToLong(strAddress As String) As Long
  1052. 'For Ping:  It changes the IP Address so it can be used to send the ping
  1053. On Error GoTo error
  1054.     Dim strTemp             As String
  1055.     Dim lAddress            As Long
  1056.     Dim iValCount           As Integer
  1057.     Dim lDotValues(1 To 4)  As String
  1058.     strTemp = strAddress
  1059.     iValCount = 0
  1060.     While InStr(strTemp, ".") > 0
  1061.         iValCount = iValCount + 1
  1062.         lDotValues(iValCount) = Mid(strTemp, 1, InStr(strTemp, ".") - 1)
  1063.         strTemp = Mid(strTemp, InStr(strTemp, ".") + 1)
  1064.         Wend
  1065.     iValCount = iValCount + 1
  1066.     lDotValues(iValCount) = strTemp
  1067.     If iValCount <> 4 Then
  1068.         ConvertIPAddressToLong = 0
  1069.         Exit Function
  1070.         End If
  1071.     lAddress = Val("&H" & Right("00" & Hex(lDotValues(4)), 2) & _
  1072.                 Right("00" & Hex(lDotValues(3)), 2) & _
  1073.                 Right("00" & Hex(lDotValues(2)), 2) & _
  1074.                 Right("00" & Hex(lDotValues(1)), 2))
  1075.     ConvertIPAddressToLong = lAddress
  1076. Exit Function
  1077. error:  MsgBox Err.Description, vbExclamation, "Error"
  1078. End Function
  1079.  
  1080. 'Section 12:  Code/Decode
  1081.  
  1082. Function Code1(text As String)
  1083. 'This codes text into different words and phrases!  Make like a secret agent..
  1084. On Error GoTo error
  1085. Dim i As Long
  1086. Dim RndN As Integer
  1087. Dim endstr As String
  1088. Randomize Timer
  1089. text$ = ReplaceC(text$, "A", "a")
  1090. text$ = ReplaceC(text$, "B", "b")
  1091. text$ = ReplaceC(text$, "C", "c")
  1092. text$ = ReplaceC(text$, "D", "d")
  1093. text$ = ReplaceC(text$, "E", "e")
  1094. text$ = ReplaceC(text$, "F", "f")
  1095. text$ = ReplaceC(text$, "G", "g")
  1096. text$ = ReplaceC(text$, "H", "h")
  1097. text$ = ReplaceC(text$, "I", "i")
  1098. text$ = ReplaceC(text$, "J", "j")
  1099. text$ = ReplaceC(text$, "K", "k")
  1100. text$ = ReplaceC(text$, "L", "l")
  1101. text$ = ReplaceC(text$, "M", "m")
  1102. text$ = ReplaceC(text$, "N", "n")
  1103. text$ = ReplaceC(text$, "O", "o")
  1104. text$ = ReplaceC(text$, "P", "p")
  1105. text$ = ReplaceC(text$, "Q", "q")
  1106. text$ = ReplaceC(text$, "R", "r")
  1107. text$ = ReplaceC(text$, "S", "s")
  1108. text$ = ReplaceC(text$, "T", "t")
  1109. text$ = ReplaceC(text$, "U", "u")
  1110. text$ = ReplaceC(text$, "V", "v")
  1111. text$ = ReplaceC(text$, "W", "w")
  1112. text$ = ReplaceC(text$, "X", "x")
  1113. text$ = ReplaceC(text$, "Y", "y")
  1114. text$ = ReplaceC(text$, "Z", "z")
  1115. text$ = ReplaceC(text$, "  ", ";")
  1116. text$ = ReplaceC(text$, " ", ",")
  1117. For i = 1 To Len(text$)
  1118. RndN = Int((3 - 0 + 1) * Rnd + 0)
  1119. If Mid$(text$, i, 1) = "a" Then
  1120.   If RndN = 0 Then
  1121.   endstr$ = endstr$ + " somewhere"
  1122.   ElseIf RndN = 1 Then
  1123.   endstr$ = endstr$ + " did you"
  1124.   ElseIf RndN = 2 Then
  1125.   endstr$ = endstr$ + " flowers"
  1126.   ElseIf RndN = 3 Then
  1127.   endstr$ = endstr$ + " eat food"
  1128.   End If
  1129. ElseIf Mid$(text$, i, 1) = "b" Then
  1130.   If RndN = 0 Then
  1131.   endstr$ = endstr$ + " light candle"
  1132.   ElseIf RndN = 1 Then
  1133.   endstr$ = endstr$ + " mirror"
  1134.   ElseIf RndN = 2 Then
  1135.   endstr$ = endstr$ + " cold soup"
  1136.   ElseIf RndN = 3 Then
  1137.   endstr$ = endstr$ + " video tape"
  1138.   End If
  1139. ElseIf Mid$(text$, i, 1) = "c" Then
  1140.   If RndN = 0 Then
  1141.   endstr$ = endstr$ + " the murder"
  1142.   ElseIf RndN = 1 Then
  1143.   endstr$ = endstr$ + " read book"
  1144.   ElseIf RndN = 2 Then
  1145.   endstr$ = endstr$ + " the show"
  1146.   ElseIf RndN = 3 Then
  1147.   endstr$ = endstr$ + " paper"
  1148.   End If
  1149. ElseIf Mid$(text$, i, 1) = "d" Then
  1150.   If RndN = 0 Then
  1151.   endstr$ = endstr$ + " beautiful"
  1152.   ElseIf RndN = 1 Then
  1153.   endstr$ = endstr$ + " do not"
  1154.   ElseIf RndN = 2 Then
  1155.   endstr$ = endstr$ + " bring"
  1156.   ElseIf RndN = 3 Then
  1157.   endstr$ = endstr$ + " that"
  1158.   End If
  1159. ElseIf Mid$(text$, i, 1) = "e" Then
  1160.   If RndN = 0 Then
  1161.   endstr$ = endstr$ + " star"
  1162.   ElseIf RndN = 1 Then
  1163.   endstr$ = endstr$ + " itself"
  1164.   ElseIf RndN = 2 Then
  1165.   endstr$ = endstr$ + " in a"
  1166.   ElseIf RndN = 3 Then
  1167.   endstr$ = endstr$ + " by"
  1168.   End If
  1169. ElseIf Mid$(text$, i, 1) = "f" Then
  1170.   If RndN = 0 Then
  1171.   endstr$ = endstr$ + " it is"
  1172.   ElseIf RndN = 1 Then
  1173.   endstr$ = endstr$ + " sea"
  1174.   ElseIf RndN = 2 Then
  1175.   endstr$ = endstr$ + " myself"
  1176.   ElseIf RndN = 3 Then
  1177.   endstr$ = endstr$ + " powerful"
  1178.   End If
  1179. ElseIf Mid$(text$, i, 1) = "g" Then
  1180.   If RndN = 0 Then
  1181.   endstr$ = endstr$ + " aren't"
  1182.   ElseIf RndN = 1 Then
  1183.   endstr$ = endstr$ + " nail filer"
  1184.   ElseIf RndN = 2 Then
  1185.   endstr$ = endstr$ + " everlasting"
  1186.   ElseIf RndN = 3 Then
  1187.   endstr$ = endstr$ + " magic"
  1188.   End If
  1189. ElseIf Mid$(text$, i, 1) = "h" Then
  1190.   If RndN = 0 Then
  1191.   endstr$ = endstr$ + " tomorrow"
  1192.   ElseIf RndN = 1 Then
  1193.   endstr$ = endstr$ + " tree"
  1194.   ElseIf RndN = 2 Then
  1195.   endstr$ = endstr$ + " it will"
  1196.   ElseIf RndN = 3 Then
  1197.   endstr$ = endstr$ + " fat"
  1198.   End If
  1199. ElseIf Mid$(text$, i, 1) = "i" Then
  1200.   If RndN = 0 Then
  1201.   endstr$ = endstr$ + " isn't"
  1202.   ElseIf RndN = 1 Then
  1203.   endstr$ = endstr$ + " explosion"
  1204.   ElseIf RndN = 2 Then
  1205.   endstr$ = endstr$ + " at school"
  1206.   ElseIf RndN = 3 Then
  1207.   endstr$ = endstr$ + " apples"
  1208.   End If
  1209. ElseIf Mid$(text$, i, 1) = "j" Then
  1210.   If RndN = 0 Then
  1211.   endstr$ = endstr$ + " when"
  1212.   ElseIf RndN = 1 Then
  1213.   endstr$ = endstr$ + " onions"
  1214.   ElseIf RndN = 2 Then
  1215.   endstr$ = endstr$ + " night"
  1216.   ElseIf RndN = 3 Then
  1217.   endstr$ = endstr$ + " about it"
  1218.   End If
  1219. ElseIf Mid$(text$, i, 1) = "k" Then
  1220.   If RndN = 0 Then
  1221.   endstr$ = endstr$ + " days"
  1222.   ElseIf RndN = 1 Then
  1223.   endstr$ = endstr$ + " right"
  1224.   ElseIf RndN = 2 Then
  1225.   endstr$ = endstr$ + " please"
  1226.   ElseIf RndN = 3 Then
  1227.   endstr$ = endstr$ + " oranges"
  1228.   End If
  1229. ElseIf Mid$(text$, i, 1) = "l" Then
  1230.   If RndN = 0 Then
  1231.   endstr$ = endstr$ + " wrong"
  1232.   ElseIf RndN = 1 Then
  1233.   endstr$ = endstr$ + " yesterday"
  1234.   ElseIf RndN = 2 Then
  1235.   endstr$ = endstr$ + " has"
  1236.   ElseIf RndN = 3 Then
  1237.   endstr$ = endstr$ + " money"
  1238.   End If
  1239. ElseIf Mid$(text$, i, 1) = "m" Then
  1240.   If RndN = 0 Then
  1241.   endstr$ = endstr$ + " today"
  1242.   ElseIf RndN = 1 Then
  1243.   endstr$ = endstr$ + " dad"
  1244.   ElseIf RndN = 2 Then
  1245.   endstr$ = endstr$ + " mother"
  1246.   ElseIf RndN = 3 Then
  1247.   endstr$ = endstr$ + " his"
  1248.   End If
  1249. ElseIf Mid$(text$, i, 1) = "n" Then
  1250.   If RndN = 0 Then
  1251.   endstr$ = endstr$ + " french"
  1252.   ElseIf RndN = 1 Then
  1253.   endstr$ = endstr$ + " hurt"
  1254.   ElseIf RndN = 2 Then
  1255.   endstr$ = endstr$ + " ham"
  1256.   ElseIf RndN = 3 Then
  1257.   endstr$ = endstr$ + " milk"
  1258.   End If
  1259. ElseIf Mid$(text$, i, 1) = "o" Then
  1260.   If RndN = 0 Then
  1261.   endstr$ = endstr$ + " not"
  1262.   ElseIf RndN = 1 Then
  1263.   endstr$ = endstr$ + " see you"
  1264.   ElseIf RndN = 2 Then
  1265.   endstr$ = endstr$ + " rot"
  1266.   ElseIf RndN = 3 Then
  1267.   endstr$ = endstr$ + " five"
  1268.   End If
  1269. ElseIf Mid$(text$, i, 1) = "p" Then
  1270.   If RndN = 0 Then
  1271.   endstr$ = endstr$ + " see me"
  1272.   ElseIf RndN = 1 Then
  1273.   endstr$ = endstr$ + " hard"
  1274.   ElseIf RndN = 2 Then
  1275.   endstr$ = endstr$ + " mask"
  1276.   ElseIf RndN = 3 Then
  1277.   endstr$ = endstr$ + " ants"
  1278.   End If
  1279. ElseIf Mid$(text$, i, 1) = "q" Then
  1280.   If RndN = 0 Then
  1281.   endstr$ = endstr$ + " yes"
  1282.   ElseIf RndN = 1 Then
  1283.   endstr$ = endstr$ + " soft"
  1284.   ElseIf RndN = 2 Then
  1285.   endstr$ = endstr$ + " four"
  1286.   ElseIf RndN = 3 Then
  1287.   endstr$ = endstr$ + " in flour"
  1288.   End If
  1289. ElseIf Mid$(text$, i, 1) = "r" Then
  1290.   If RndN = 0 Then
  1291.   endstr$ = endstr$ + " no"
  1292.   ElseIf RndN = 1 Then
  1293.   endstr$ = endstr$ + " fast"
  1294.   ElseIf RndN = 2 Then
  1295.   endstr$ = endstr$ + " three"
  1296.   ElseIf RndN = 3 Then
  1297.   endstr$ = endstr$ + " cat"
  1298.   End If
  1299. ElseIf Mid$(text$, i, 1) = "s" Then
  1300.   If RndN = 0 Then
  1301.   endstr$ = endstr$ + " slow"
  1302.   ElseIf RndN = 1 Then
  1303.   endstr$ = endstr$ + " super"
  1304.   ElseIf RndN = 2 Then
  1305.   endstr$ = endstr$ + " two"
  1306.   ElseIf RndN = 3 Then
  1307.   endstr$ = endstr$ + " over the"
  1308.   End If
  1309. ElseIf Mid$(text$, i, 1) = "t" Then
  1310.   If RndN = 0 Then
  1311.   endstr$ = endstr$ + " medium"
  1312.   ElseIf RndN = 1 Then
  1313.   endstr$ = endstr$ + " hit"
  1314.   ElseIf RndN = 2 Then
  1315.   endstr$ = endstr$ + " one"
  1316.   ElseIf RndN = 3 Then
  1317.   endstr$ = endstr$ + " rainbow"
  1318.   End If
  1319. ElseIf Mid$(text$, i, 1) = "u" Then
  1320.   If RndN = 0 Then
  1321.   endstr$ = endstr$ + " zero"
  1322.   ElseIf RndN = 1 Then
  1323.   endstr$ = endstr$ + " fire"
  1324.   ElseIf RndN = 2 Then
  1325.   endstr$ = endstr$ + " ice"
  1326.   ElseIf RndN = 3 Then
  1327.   endstr$ = endstr$ + " malt"
  1328.   End If
  1329. ElseIf Mid$(text$, i, 1) = "v" Then
  1330.   If RndN = 0 Then
  1331.   endstr$ = endstr$ + " six"
  1332.   ElseIf RndN = 1 Then
  1333.   endstr$ = endstr$ + " hair"
  1334.   ElseIf RndN = 2 Then
  1335.   endstr$ = endstr$ + " light switch"
  1336.   ElseIf RndN = 3 Then
  1337.   endstr$ = endstr$ + " metal"
  1338.   End If
  1339. ElseIf Mid$(text$, i, 1) = "w" Then
  1340.   If RndN = 0 Then
  1341.   endstr$ = endstr$ + " computer"
  1342.   ElseIf RndN = 1 Then
  1343.   endstr$ = endstr$ + " comb"
  1344.   ElseIf RndN = 2 Then
  1345.   endstr$ = endstr$ + " bomb"
  1346.   ElseIf RndN = 3 Then
  1347.   endstr$ = endstr$ + " writing"
  1348.   End If
  1349. ElseIf Mid$(text$, i, 1) = "x" Then
  1350.   If RndN = 0 Then
  1351.   endstr$ = endstr$ + " eight ball"
  1352.   ElseIf RndN = 1 Then
  1353.   endstr$ = endstr$ + " smear"
  1354.   ElseIf RndN = 2 Then
  1355.   endstr$ = endstr$ + " letter"
  1356.   ElseIf RndN = 3 Then
  1357.   endstr$ = endstr$ + " cups"
  1358.   End If
  1359. ElseIf Mid$(text$, i, 1) = "y" Then
  1360.   If RndN = 0 Then
  1361.   endstr$ = endstr$ + " nine"
  1362.   ElseIf RndN = 1 Then
  1363.   endstr$ = endstr$ + " table"
  1364.   ElseIf RndN = 2 Then
  1365.   endstr$ = endstr$ + " basket"
  1366.   ElseIf RndN = 3 Then
  1367.   endstr$ = endstr$ + " open door"
  1368.   End If
  1369. ElseIf Mid$(text$, i, 1) = "z" Then
  1370.   If RndN = 0 Then
  1371.   endstr$ = endstr$ + " ten"
  1372.   ElseIf RndN = 1 Then
  1373.   endstr$ = endstr$ + " to car"
  1374.   ElseIf RndN = 2 Then
  1375.   endstr$ = endstr$ + " hallway"
  1376.   ElseIf RndN = 3 Then
  1377.   endstr$ = endstr$ + " in house"
  1378.   End If
  1379. Else
  1380. endstr$ = endstr$ + Mid$(text$, i, 1)
  1381. End If
  1382. Next i
  1383. endstr$ = Mid$(endstr$, 2, Len(endstr$) - 1)
  1384. Code1 = endstr$
  1385. Exit Function
  1386. error:  MsgBox Err.Description, vbExclamation, "Error"
  1387. End Function
  1388.  
  1389. Function Code2(text As String)
  1390. 'This is a simpler (and smaller) coding system than code 1
  1391. On Error GoTo error
  1392. text$ = ReplaceC(text$, "  ", ";")
  1393. text$ = ReplaceC(text$, " ", ",")
  1394. text$ = ReplaceC(text$, "A", "a")
  1395. text$ = ReplaceC(text$, "B", "b")
  1396. text$ = ReplaceC(text$, "C", "c")
  1397. text$ = ReplaceC(text$, "D", "d")
  1398. text$ = ReplaceC(text$, "E", "e")
  1399. text$ = ReplaceC(text$, "F", "f")
  1400. text$ = ReplaceC(text$, "G", "g")
  1401. text$ = ReplaceC(text$, "H", "h")
  1402. text$ = ReplaceC(text$, "I", "i")
  1403. text$ = ReplaceC(text$, "J", "j")
  1404. text$ = ReplaceC(text$, "K", "k")
  1405. text$ = ReplaceC(text$, "L", "l")
  1406. text$ = ReplaceC(text$, "M", "m")
  1407. text$ = ReplaceC(text$, "N", "n")
  1408. text$ = ReplaceC(text$, "O", "o")
  1409. text$ = ReplaceC(text$, "P", "p")
  1410. text$ = ReplaceC(text$, "Q", "q")
  1411. text$ = ReplaceC(text$, "R", "r")
  1412. text$ = ReplaceC(text$, "S", "s")
  1413. text$ = ReplaceC(text$, "T", "t")
  1414. text$ = ReplaceC(text$, "U", "u")
  1415. text$ = ReplaceC(text$, "V", "v")
  1416. text$ = ReplaceC(text$, "W", "w")
  1417. text$ = ReplaceC(text$, "X", "x")
  1418. text$ = ReplaceC(text$, "Y", "y")
  1419. text$ = ReplaceC(text$, "Z", "z")
  1420. text$ = ReplaceC(text$, "a", " IT")
  1421. text$ = ReplaceC(text$, "b", " AE")
  1422. text$ = ReplaceC(text$, "c", " TA")
  1423. text$ = ReplaceC(text$, "d", " EA")
  1424. text$ = ReplaceC(text$, "e", " NA")
  1425. text$ = ReplaceC(text$, "f", " NT")
  1426. text$ = ReplaceC(text$, "g", " IE")
  1427. text$ = ReplaceC(text$, "h", " NN")
  1428. text$ = ReplaceC(text$, "i", " TE")
  1429. text$ = ReplaceC(text$, "j", " EI")
  1430. text$ = ReplaceC(text$, "k", " TI")
  1431. text$ = ReplaceC(text$, "l", " II")
  1432. text$ = ReplaceC(text$, "m", " NE")
  1433. text$ = ReplaceC(text$, "n", " AI")
  1434. text$ = ReplaceC(text$, "o", " TN")
  1435. text$ = ReplaceC(text$, "p", " AA")
  1436. text$ = ReplaceC(text$, "q", " EN")
  1437. text$ = ReplaceC(text$, "r", " IN")
  1438. text$ = ReplaceC(text$, "s", " AT")
  1439. text$ = ReplaceC(text$, "t", " AN")
  1440. text$ = ReplaceC(text$, "u", " NI")
  1441. text$ = ReplaceC(text$, "v", " EE")
  1442. text$ = ReplaceC(text$, "w", " TT")
  1443. text$ = ReplaceC(text$, "x", " XX")
  1444. text$ = ReplaceC(text$, "y", " ET")
  1445. text$ = ReplaceC(text$, "z", " IA")
  1446. text$ = Mid$(text$, 2, Len(text$) - 1)
  1447. Code2 = text$
  1448. Exit Function
  1449. error:  MsgBox Err.Description, vbExclamation, "Error"
  1450. End Function
  1451.  
  1452. Function Decode1(text As String)
  1453. 'This decodes text coded by code 1
  1454. On Error GoTo error
  1455. text$ = " " & text$
  1456. text$ = ReplaceC(text$, " somewhere", "a")
  1457. text$ = ReplaceC(text$, " did you", "a")
  1458. text$ = ReplaceC(text$, " flowers", "a")
  1459. text$ = ReplaceC(text$, " eat food", "a")
  1460. text$ = ReplaceC(text$, " light candle", "b")
  1461. text$ = ReplaceC(text$, " mirror", "b")
  1462. text$ = ReplaceC(text$, " cold soup", "b")
  1463. text$ = ReplaceC(text$, " video tape", "b")
  1464. text$ = ReplaceC(text$, " the murder", "c")
  1465. text$ = ReplaceC(text$, " read book", "c")
  1466. text$ = ReplaceC(text$, " the show", "c")
  1467. text$ = ReplaceC(text$, " paper", "c")
  1468. text$ = ReplaceC(text$, " beautiful", "d")
  1469. text$ = ReplaceC(text$, " do not", "d")
  1470. text$ = ReplaceC(text$, " bring", "d")
  1471. text$ = ReplaceC(text$, " that", "d")
  1472. text$ = ReplaceC(text$, " star", "e")
  1473. text$ = ReplaceC(text$, " itself", "e")
  1474. text$ = ReplaceC(text$, " in a", "e")
  1475. text$ = ReplaceC(text$, " by", "e")
  1476. text$ = ReplaceC(text$, " it is", "f")
  1477. text$ = ReplaceC(text$, " sea", "f")
  1478. text$ = ReplaceC(text$, " myself", "f")
  1479. text$ = ReplaceC(text$, " powerful", "f")
  1480. text$ = ReplaceC(text$, " aren't", "g")
  1481. text$ = ReplaceC(text$, " nail filer", "g")
  1482. text$ = ReplaceC(text$, " everlasting", "g")
  1483. text$ = ReplaceC(text$, " magic", "g")
  1484. text$ = ReplaceC(text$, " tomorrow", "h")
  1485. text$ = ReplaceC(text$, " tree", "h")
  1486. text$ = ReplaceC(text$, " it will", "h")
  1487. text$ = ReplaceC(text$, " fat", "h")
  1488. text$ = ReplaceC(text$, " isn't", "i")
  1489. text$ = ReplaceC(text$, " explosion", "i")
  1490. text$ = ReplaceC(text$, " at school", "i")
  1491. text$ = ReplaceC(text$, " apples", "i")
  1492. text$ = ReplaceC(text$, " when", "j")
  1493. text$ = ReplaceC(text$, " onions", "j")
  1494. text$ = ReplaceC(text$, " night", "j")
  1495. text$ = ReplaceC(text$, " about it", "j")
  1496. text$ = ReplaceC(text$, " days", "k")
  1497. text$ = ReplaceC(text$, " right", "k")
  1498. text$ = ReplaceC(text$, " please", "k")
  1499. text$ = ReplaceC(text$, " oranges", "k")
  1500. text$ = ReplaceC(text$, " wrong", "l")
  1501. text$ = ReplaceC(text$, " yesterday", "l")
  1502. text$ = ReplaceC(text$, " has", "l")
  1503. text$ = ReplaceC(text$, " money", "l")
  1504. text$ = ReplaceC(text$, " today", "m")
  1505. text$ = ReplaceC(text$, " had", "m")
  1506. text$ = ReplaceC(text$, " mother", "m")
  1507. text$ = ReplaceC(text$, " his", "m")
  1508. text$ = ReplaceC(text$, " french", "n")
  1509. text$ = ReplaceC(text$, " hurt", "n")
  1510. text$ = ReplaceC(text$, " ham", "n")
  1511. text$ = ReplaceC(text$, " milk", "n")
  1512. text$ = ReplaceC(text$, " not", "o")
  1513. text$ = ReplaceC(text$, " see you", "o")
  1514. text$ = ReplaceC(text$, " rot", "o")
  1515. text$ = ReplaceC(text$, " five", "o")
  1516. text$ = ReplaceC(text$, " see me", "p")
  1517. text$ = ReplaceC(text$, " hard", "p")
  1518. text$ = ReplaceC(text$, " mask", "p")
  1519. text$ = ReplaceC(text$, " ants", "p")
  1520. text$ = ReplaceC(text$, " yes", "q")
  1521. text$ = ReplaceC(text$, " soft", "q")
  1522. text$ = ReplaceC(text$, " four", "q")
  1523. text$ = ReplaceC(text$, " in flour", "q")
  1524. text$ = ReplaceC(text$, " no", "r")
  1525. text$ = ReplaceC(text$, " fast", "r")
  1526. text$ = ReplaceC(text$, " three", "r")
  1527. text$ = ReplaceC(text$, " cat", "r")
  1528. text$ = ReplaceC(text$, " slow", "s")
  1529. text$ = ReplaceC(text$, " super", "s")
  1530. text$ = ReplaceC(text$, " two", "s")
  1531. text$ = ReplaceC(text$, " over the", "s")
  1532. text$ = ReplaceC(text$, " medium", "t")
  1533. text$ = ReplaceC(text$, " hit", "t")
  1534. text$ = ReplaceC(text$, " one", "t")
  1535. text$ = ReplaceC(text$, " rainbow", "t")
  1536. text$ = ReplaceC(text$, " zero", "u")
  1537. text$ = ReplaceC(text$, " fire", "u")
  1538. text$ = ReplaceC(text$, " ice", "u")
  1539. text$ = ReplaceC(text$, " malt", "u")
  1540. text$ = ReplaceC(text$, " six", "v")
  1541. text$ = ReplaceC(text$, " hair", "v")
  1542. text$ = ReplaceC(text$, " light switch", "v")
  1543. text$ = ReplaceC(text$, " metal", "v")
  1544. text$ = ReplaceC(text$, " computer", "w")
  1545. text$ = ReplaceC(text$, " comb", "w")
  1546. text$ = ReplaceC(text$, " bomb", "w")
  1547. text$ = ReplaceC(text$, " writing", "w")
  1548. text$ = ReplaceC(text$, " eight ball", "x")
  1549. text$ = ReplaceC(text$, " smear", "x")
  1550. text$ = ReplaceC(text$, " letter", "x")
  1551. text$ = ReplaceC(text$, " cups", "x")
  1552. text$ = ReplaceC(text$, " nine", "y")
  1553. text$ = ReplaceC(text$, " table", "y")
  1554. text$ = ReplaceC(text$, " basket", "y")
  1555. text$ = ReplaceC(text$, " open door", "y")
  1556. text$ = ReplaceC(text$, " ten", "z")
  1557. text$ = ReplaceC(text$, " to car", "z")
  1558. text$ = ReplaceC(text$, " hallway", "z")
  1559. text$ = ReplaceC(text$, " in house", "z")
  1560. text$ = ReplaceC(text$, ";", "  ")
  1561. text$ = ReplaceC(text$, ",", " ")
  1562. Decode1 = text$
  1563. Exit Function
  1564. error:  MsgBox Err.Description, vbExclamation, "Error"
  1565. End Function
  1566.  
  1567. Function Decode2(text As String)
  1568. 'This decodes text coded by code 2
  1569. On Error GoTo error
  1570. text$ = " " & text$
  1571. text$ = ReplaceC(text$, " IT", "a")
  1572. text$ = ReplaceC(text$, " AE", "b")
  1573. text$ = ReplaceC(text$, " TA", "c")
  1574. text$ = ReplaceC(text$, " EA", "d")
  1575. text$ = ReplaceC(text$, " NA", "e")
  1576. text$ = ReplaceC(text$, " NT", "f")
  1577. text$ = ReplaceC(text$, " IE", "g")
  1578. text$ = ReplaceC(text$, " NN", "h")
  1579. text$ = ReplaceC(text$, " TE", "i")
  1580. text$ = ReplaceC(text$, " EI", "j")
  1581. text$ = ReplaceC(text$, " TI", "k")
  1582. text$ = ReplaceC(text$, " II", "l")
  1583. text$ = ReplaceC(text$, " NE", "m")
  1584. text$ = ReplaceC(text$, " AI", "n")
  1585. text$ = ReplaceC(text$, " TN", "o")
  1586. text$ = ReplaceC(text$, " AA", "p")
  1587. text$ = ReplaceC(text$, " EN", "q")
  1588. text$ = ReplaceC(text$, " IN", "r")
  1589. text$ = ReplaceC(text$, " AT", "s")
  1590. text$ = ReplaceC(text$, " AN", "t")
  1591. text$ = ReplaceC(text$, " NI", "u")
  1592. text$ = ReplaceC(text$, " EE", "v")
  1593. text$ = ReplaceC(text$, " TT", "w")
  1594. text$ = ReplaceC(text$, " XX", "x")
  1595. text$ = ReplaceC(text$, " ET", "y")
  1596. text$ = ReplaceC(text$, " IA", "z")
  1597. text$ = ReplaceC(text$, ";", "  ")
  1598. text$ = ReplaceC(text$, ",", " ")
  1599. Decode2 = text$
  1600. Exit Function
  1601. error:  MsgBox Err.Description, vbExclamation, "Error"
  1602. End Function
  1603.  
  1604. Private Function ReplaceC(MainStr As String, OldStr As String, NewStr As String) As String
  1605. 'For Section 12 (Code/Decode):  Replaces one string with another
  1606. On Error GoTo error
  1607. ReplaceC = ""
  1608. Dim NewStrString As String
  1609. Dim i As Integer
  1610. For i = 1 To Len(MainStr)
  1611.   If Mid(MainStr, i, Len(OldStr)) = OldStr Then
  1612.   NewStrString = NewStrString & NewStr
  1613.   i = i + Len(OldStr) - 1
  1614.   Else
  1615.   NewStrString = NewStrString & Mid(MainStr, i, 1)
  1616.   End If
  1617. Next i
  1618. ReplaceC = NewStrString
  1619. Exit Function
  1620. error:  MsgBox Err.Description, vbExclamation, "Error"
  1621. End Function
  1622.  
  1623. 'Section 13:  Math
  1624.  
  1625. Function Add(num1 As Long, num2 As Long) As Long
  1626. 'Add two numbers
  1627. On Error GoTo error
  1628. Add = Val(num1) + Val(num2)
  1629. Exit Function
  1630. error:  MsgBox Err.Description, vbExclamation, "Error"
  1631. End Function
  1632.  
  1633. Function Subtract(num1 As Long, num2 As Long) As Long
  1634. 'Subtract two numbers
  1635. On Error GoTo error
  1636. Subtract = Val(num1) - Val(num2)
  1637. Exit Function
  1638. error:  MsgBox Err.Description, vbExclamation, "Error"
  1639. End Function
  1640.  
  1641. Function Divide(num1 As Long, num2 As Long) As Long
  1642. 'Divide two numbers
  1643. On Error GoTo error
  1644. Divide = Val(num1) / Val(num2)
  1645. Exit Function
  1646. error:  MsgBox Err.Description, vbExclamation, "Error"
  1647. End Function
  1648.  
  1649. Function Multiply(num1 As Long, num2 As Long) As Long
  1650. 'Multiply two numbers
  1651. On Error GoTo error
  1652. Multiply = Val(num1) * Val(num2)
  1653. Exit Function
  1654. error:  MsgBox Err.Description, vbExclamation, "Error"
  1655. End Function
  1656.  
  1657. Function ToPower(num1 As Long, num2 As Long) As Long
  1658. 'Bring num1 to the power (exponent) of num2
  1659. On Error GoTo error
  1660. ToPower = Val(num1) ^ Val(num2)
  1661. Exit Function
  1662. error:  MsgBox Err.Description, vbExclamation, "Error"
  1663. End Function
  1664.  
  1665. Function ToRoot(num1 As Long, num2 As Long) As Long
  1666. 'Bring num1 to the root of num2
  1667. On Error GoTo error
  1668. ToRoot = Val(num1) ^ (1 / Val(num2))
  1669. Exit Function
  1670. error:  MsgBox Err.Description, vbExclamation, "Error"
  1671. End Function
  1672.  
  1673. Function FractionToDecimal(numerator As Integer, denominator As Integer) As Long
  1674. 'Turns a fraction into a decimal
  1675. On Error GoTo error
  1676. FractionToDecimal = numerator / denominator
  1677. Exit Function
  1678. error:  MsgBox Err.Description, vbExclamation, "Error"
  1679. End Function
  1680.  
  1681. Function DecimalToPercentage(DecimalNum As Long) As String
  1682. 'Turns a decimal into a percentage
  1683. On Error GoTo error
  1684. DecimalToPercentage = (DecimalNum * 100) & "%"
  1685. Exit Function
  1686. error:  MsgBox Err.Description, vbExclamation, "Error"
  1687. End Function
  1688.  
  1689. Function PercentageToDeciaml(PercentNum As String) As Long
  1690. 'Turns a percentage into a decimal
  1691. On Error GoTo error
  1692. If Mid$(PercentNum$, Len(PercentNum$), 1) = "%" Then
  1693. PercentNum$ = Mid$(PercentNum$, 2, Len(PercentNum$) - 1)
  1694. End If
  1695. PercentageToDecimal = Val(PercentNum$) / 100
  1696. Exit Function
  1697. error:  MsgBox Err.Description, vbExclamation, "Error"
  1698. End Function
  1699.  
  1700. Function AreaOfCircle(radius As Long)
  1701. 'Gets the area of a circle
  1702. On Error GoTo error
  1703. pi = 3.141592654
  1704. AreaOfCircle = pi * (radius ^ 2)
  1705. Exit Function
  1706. error:  MsgBox Err.Description, vbExclamation, "Error"
  1707. End Function
  1708.  
  1709. Function Circumference(radius As Long)
  1710. 'Gets the circumference of a circle
  1711. On Error GoTo error
  1712. pi = 3.141592654
  1713. Circumference = pi * 2 * radius
  1714. Exit Function
  1715. error:  MsgBox Err.Description, vbExclamation, "Error"
  1716. End Function
  1717.  
  1718. Function AreaOfSquare(side As Long)
  1719. 'Gets the area of a square
  1720. On Error GoTo error
  1721. AreaOfSquare = side ^ 2
  1722. Exit Function
  1723. error:  MsgBox Err.Description, vbExclamation, "Error"
  1724. End Function
  1725.  
  1726. Function PerimeterOfSquare(side As Long)
  1727. 'Gets the perimeter of a square
  1728. On Error GoTo error
  1729. PerimeterOfSquare = 4 * side
  1730. Exit Function
  1731. error:  MsgBox Err.Description, vbExclamation, "Error"
  1732. End Function
  1733.  
  1734. Function PerimeterOfRectangle(Length As Long, width As Long)
  1735. 'Gets the perimeter of a rectangle
  1736. On Error GoTo error
  1737. PerimeterOfRectangle = (2 * Length) + (2 * width)
  1738. Exit Function
  1739. error:  MsgBox Err.Description, vbExclamation, "Error"
  1740. End Function
  1741.  
  1742. Function AreaOfRectangle(Length As Long, width As Long)
  1743. 'Gets the area of a rectangle
  1744. On Error GoTo error
  1745. AreaOfRectangle = Length * width
  1746. Exit Function
  1747. error:  MsgBox Err.Description, vbExclamation, "Error"
  1748. End Function
  1749.  
  1750. Function AreaOfTriangle(base As Long, height As Long)
  1751. 'Gets the area of a triangle
  1752. On Error GoTo error
  1753. AreaOfTriangle = (1 / 2) * base * height
  1754. Exit Function
  1755. error:  MsgBox Err.Description, vbExclamation, "Error"
  1756. End Function
  1757.  
  1758. Function PerimeterOfTriangle(side1 As Long, side2 As Long, side3 As Long)
  1759. 'Gets the perimeter of a triangle
  1760. On Error GoTo error
  1761. PerimeterOfTriangle = side1 + side2 + side3
  1762. Exit Function
  1763. error:  MsgBox Err.Description, vbExclamation, "Error"
  1764. End Function
  1765.  
  1766. Function PerimeterOf4SidedPolygon(side1 As Long, side2 As Long, side3 As Long, side4 As Long)
  1767. 'Gets the perimeter of any 4 sided polygon
  1768. On Error GoTo error
  1769. PerimeterOf4SidedPolygon = side1 + side2 + side3 + side4
  1770. Exit Function
  1771. error:  MsgBox Err.Description, vbExclamation, "Error"
  1772. End Function
  1773.  
  1774. Function VolumeOfCube(edge As Long)
  1775. 'Gets the volume of a cube
  1776. On Error GoTo error
  1777. VolumeOfCube = edge ^ 3
  1778. Exit Function
  1779. error:  MsgBox Err.Description, vbExclamation, "Error"
  1780. End Function
  1781.  
  1782. Function VolumeOfPrism(base As Long, height As Long)
  1783. 'Gets the volume of a prism
  1784. On Error GoTo error
  1785. VolumeOfPrism = base * height
  1786. Exit Function
  1787. error:  MsgBox Err.Description, vbExclamation, "Error"
  1788. End Function
  1789.  
  1790. Function VolumeOfSphere(radius As Long)
  1791. 'Gets the volume of a sphere
  1792. On Error GoTo error
  1793. pi = 3.141592654
  1794. VolumeOfSphere = (4 / 3) * pi * (radius ^ 3)
  1795. Exit Function
  1796. error:  MsgBox Err.Description, vbExclamation, "Error"
  1797. End Function
  1798.  
  1799. Function VolumeOfPyramid(base As Long, height As Long)
  1800. 'Gets the volume of a pyramid
  1801. On Error GoTo error
  1802. VolumeOfPyramid = (1 / 3) * base * height
  1803. Exit Function
  1804. error:  MsgBox Err.Description, vbExclamation, "Error"
  1805. End Function
  1806.  
  1807. Function VolumeOfCone(radius As Long, height As Long)
  1808. 'Gets the volume of a cone
  1809. On Error GoTo error
  1810. pi = 3.141592654
  1811. VolumeOfCone = (1 / 3) * pi * (radius ^ 2) * height
  1812. Exit Function
  1813. error:  MsgBox Err.Description, vbExclamation, "Error"
  1814. End Function
  1815.  
  1816. Function VolumeOfCylinder(radius As Long, height As Long)
  1817. 'Gets the volume of a cylinder
  1818. On Error GoTo error
  1819. pi = 3.141592654
  1820. VolumeOfCylinder = pi * height * (radius ^ 2)
  1821. Exit Function
  1822. error:  MsgBox Err.Description, vbExclamation, "Error"
  1823. End Function
  1824.  
  1825. 'Section 14:  Color Fading
  1826.  
  1827. Function FadeThreeColorHTML(R1%, G1%, B1%, R2%, G2%, B2%, R3%, G3%, B3%, thetext$)
  1828. 'This will fade three colors in HTML color coding
  1829. On Error GoTo error
  1830. textlen% = Len(thetext)
  1831. fstlen% = (Int(textlen%) / 2)
  1832. part1$ = Left(thetext, fstlen%)
  1833. part2$ = Right(thetext, textlen% - fstlen%)
  1834. textlen% = Len(part1$)
  1835. For i = 1 To textlen%
  1836. TextDone$ = Left(part1$, i)
  1837. LastChr$ = Right(TextDone$, 1)
  1838. ColorX = RGB(((B2 - B1) / textlen% * i) + B1, ((G2 - G1) / textlen% * i) + G1, ((R2 - R1) / textlen% * i) + R1)
  1839. colorx2 = RGBToHex(ColorX)
  1840. Faded1$ = Faded1$ + "<FONT COLOR=" & colorx2 & ">" + LastChr$ + "</FONT>"
  1841. Next i
  1842. textlen% = Len(part2$)
  1843. For i = 1 To textlen%
  1844. TextDone$ = Left(part2$, i)
  1845. LastChr$ = Right(TextDone$, 1)
  1846. ColorX = RGB(((B3 - B2) / textlen% * i) + B2, ((G3 - G2) / textlen% * i) + G2, ((R3 - R2) / textlen% * i) + R2)
  1847. colorx2 = RGBToHex(ColorX)
  1848. Faded2$ = Faded2$ + "<FONT COLOR=" & colorx2 & ">" + LastChr$ + "</FONT>"
  1849. Next i
  1850. FadeThreeColorHTML = Faded1$ + Faded2$
  1851. Exit Function
  1852. error:  MsgBox Err.Description, vbExclamation, "Error"
  1853. End Function
  1854.  
  1855. Private Function FadeTwoColorHTML(R1%, G1%, B1%, R2%, G2%, B2%, thetext$)
  1856. 'This will fade two colors in HTML color coding
  1857. On Error GoTo error
  1858. textlen$ = Len(thetext)
  1859. For i = 1 To textlen$
  1860. TextDone$ = Left(thetext, i)
  1861. LastChr$ = Right(TextDone$, 1)
  1862. ColorX = RGB(((B2 - B1) / textlen$ * i) + B1, ((G2 - G1) / textlen$ * i) + G1, ((R2 - R1) / textlen$ * i) + R1)
  1863. colorx2 = RGBToHex(ColorX)
  1864. Faded$ = Faded$ + "<FONT COLOR=" & colorx2 & ">" + LastChr$ + "</FONT>"
  1865. Next i
  1866. FadeTwoColorHTML = Faded$
  1867. Exit Function
  1868. error:  MsgBox Err.Description, vbExclamation, "Error"
  1869. End Function
  1870.  
  1871. Function FadeThreeColorYahoo(R1%, G1%, B1%, R2%, G2%, B2%, R3%, G3%, B3%, thetext$)
  1872. 'This will fade three colors in Yahoo color coding
  1873. On Error GoTo error
  1874. textlen% = Len(thetext)
  1875. fstlen% = (Int(textlen%) / 2)
  1876. part1$ = Left(thetext, fstlen%)
  1877. part2$ = Right(thetext, textlen% - fstlen%)
  1878. textlen% = Len(part1$)
  1879. For i = 1 To textlen%
  1880. TextDone$ = Left(part1$, i)
  1881. LastChr$ = Right(TextDone$, 1)
  1882. ColorX = RGB(((B2 - B1) / textlen% * i) + B1, ((G2 - G1) / textlen% * i) + G1, ((R2 - R1) / textlen% * i) + R1)
  1883. colorx2 = RGBToHex(ColorX)
  1884. Faded1$ = Faded1$ + "<#" & colorx2 & ">" + LastChr$
  1885. Next i
  1886. textlen% = Len(part2$)
  1887. For i = 1 To textlen%
  1888. TextDone$ = Left(part2$, i)
  1889. LastChr$ = Right(TextDone$, 1)
  1890. ColorX = RGB(((B3 - B2) / textlen% * i) + B2, ((G3 - G2) / textlen% * i) + G2, ((R3 - R2) / textlen% * i) + R2)
  1891. colorx2 = RGBToHex(ColorX)
  1892. Faded2$ = Faded2$ + "<#" & colorx2 & ">" + LastChr$
  1893. Next i
  1894. FadeThreeColorYahoo = Faded1$ + Faded2$
  1895. Exit Function
  1896. error:  MsgBox Err.Description, vbExclamation, "Error"
  1897. End Function
  1898.  
  1899. Private Function FadeTwoColorYahoo(R1%, G1%, B1%, R2%, G2%, B2%, thetext$)
  1900. 'This will fade two colors in Yahoo color coding
  1901. On Error GoTo error
  1902. textlen$ = Len(thetext)
  1903. For i = 1 To textlen$
  1904. TextDone$ = Left(thetext, i)
  1905. LastChr$ = Right(TextDone$, 1)
  1906. ColorX = RGB(((B2 - B1) / textlen$ * i) + B1, ((G2 - G1) / textlen$ * i) + G1, ((R2 - R1) / textlen$ * i) + R1)
  1907. colorx2 = RGBToHex(ColorX)
  1908. Faded$ = Faded$ + "<#" & colorx2 & ">" + LastChr$
  1909. Next i
  1910. FadeTwoColorYahoo = Faded$
  1911. Exit Function
  1912. error:  MsgBox Err.Description, vbExclamation, "Error"
  1913. End Function
  1914.  
  1915. Function FadeThreeColorANSI(R1%, G1%, B1%, R2%, G2%, B2%, R3%, G3%, B3%, thetext$)
  1916. 'This will fade three colors in ANSI color coding
  1917. On Error GoTo error
  1918. textlen% = Len(thetext)
  1919. fstlen% = (Int(textlen%) / 2)
  1920. part1$ = Left(thetext, fstlen%)
  1921. part2$ = Right(thetext, textlen% - fstlen%)
  1922. textlen% = Len(part1$)
  1923. For i = 1 To textlen%
  1924. TextDone$ = Left(part1$, i)
  1925. LastChr$ = Right(TextDone$, 1)
  1926. ColorX = RGB(((B2 - B1) / textlen% * i) + B1, ((G2 - G1) / textlen% * i) + G1, ((R2 - R1) / textlen% * i) + R1)
  1927. colorx2 = RGBToHex(ColorX)
  1928. Faded1$ = Faded1$ + "#" & colorx2 & LastChr$
  1929. Next i
  1930. textlen% = Len(part2$)
  1931. For i = 1 To textlen%
  1932. TextDone$ = Left(part2$, i)
  1933. LastChr$ = Right(TextDone$, 1)
  1934. ColorX = RGB(((B3 - B2) / textlen% * i) + B2, ((G3 - G2) / textlen% * i) + G2, ((R3 - R2) / textlen% * i) + R2)
  1935. colorx2 = RGBToHex(ColorX)
  1936. Faded2$ = Faded2$ + "#" & colorx2 & LastChr$
  1937. Next i
  1938. FadeThreeColorANSI = Faded1$ + Faded2$
  1939. Exit Function
  1940. error:  MsgBox Err.Description, vbExclamation, "Error"
  1941. End Function
  1942.  
  1943. Private Function FadeTwoColorANSI(R1%, G1%, B1%, R2%, G2%, B2%, thetext$)
  1944. 'This will fade two colors in ANSI color coding
  1945. On Error GoTo error
  1946. textlen$ = Len(thetext)
  1947. For i = 1 To textlen$
  1948. TextDone$ = Left(thetext, i)
  1949. LastChr$ = Right(TextDone$, 1)
  1950. ColorX = RGB(((B2 - B1) / textlen$ * i) + B1, ((G2 - G1) / textlen$ * i) + G1, ((R2 - R1) / textlen$ * i) + R1)
  1951. colorx2 = RGBToHex(ColorX)
  1952. Faded$ = Faded$ + "#" & colorx2 & LastChr$
  1953. Next i
  1954. FadeTwoColorANSI = Faded$
  1955. Exit Function
  1956. error:  MsgBox Err.Description, vbExclamation, "Error"
  1957. End Function
  1958.  
  1959. 'Section 15:  Exit/Restart/Reboot Computer
  1960.  
  1961. Function RestartWindows()
  1962. 'This will restart windows
  1963. On Error GoTo error
  1964. Dim RetVal As Integer
  1965. RetVal = ExitWindows(EW_RESTARTWINDOWS, 0)
  1966. RestartWindows = RetVal
  1967. Exit Function
  1968. error:  MsgBox Err.Description, vbExclamation, "Error"
  1969. End Function
  1970.  
  1971. Function DoExitWindows()
  1972. 'This will exit windows
  1973. On Error GoTo error
  1974. Dim RetVal As Integer
  1975. RetVal = ExitWindows(EW_EXITWINDOWS, 0)
  1976. ExitWindows = RetVal
  1977. Exit Function
  1978. error:  MsgBox Err.Description, vbExclamation, "Error"
  1979. End Function
  1980.  
  1981. Function RebootComputer()
  1982. 'This will reboot the computer
  1983. On Error GoTo error
  1984. Dim RetVal As Integer
  1985. RetVal = ExitWindows(EW_REBOOTSYSTEM, 0)
  1986. RebootComputer = RetVal
  1987. Exit Function
  1988. error:  MsgBox Err.Description, vbExclamation, "Error"
  1989. End Function
  1990.  
  1991. 'Section 16:  Text$ "Changers"
  1992.  
  1993. Function AltCaps(text As String)
  1994. 'This will make the caps in text go on and off for each letter, like this:  cOoL
  1995. On Error GoTo error
  1996. Dim i As Integer
  1997. Dim s As String
  1998. s = ""
  1999. For i = 1 To Len(text$)
  2000.   KeyVal = Asc(Mid$(text$, i, 1))
  2001.   If (KeyVal >= 96 And KeyVal < 96 + 26) Or (KeyVal >= 64 And KeyVal < 64 + 26) Then
  2002.     If (i And 1) = 1 Then
  2003.       If KeyVal < 96 Then
  2004.         s = s + Chr$(96 + KeyVal - 64)
  2005.       Else
  2006.         s = s + Chr$(KeyVal)
  2007.       End If
  2008.     Else
  2009.       If KeyVal >= 96 Then
  2010.         s = s + Chr$(64 + KeyVal - 96)
  2011.       Else
  2012.         s = s + Chr$(KeyVal)
  2013.       End If
  2014.     End If
  2015.   Else
  2016.     s = s + Chr$(KeyVal)
  2017.   End If
  2018. Next i
  2019. text$ = s
  2020. AltCaps = text$
  2021. Exit Function
  2022. error:  MsgBox Err.Description, vbExclamation, "Error"
  2023. End Function
  2024.  
  2025. Function BackwardsText(text As String)
  2026. 'This will make text go backwards, like this:  looC (Cool)
  2027. On Error GoTo error
  2028. For i% = 1 To Len(text$)
  2029. stringy$ = Mid$(text$, i%, 1)
  2030. final$ = stringy$ + final$
  2031. Next i%
  2032. BackwardsText = final$
  2033. Exit Function
  2034. error:  MsgBox Err.Description, vbExclamation, "Error"
  2035. End Function
  2036.  
  2037. Function EliteType(text As String)
  2038. 'This will change characters to make them "elite", example:  ⌐00|_
  2039. On Error GoTo error
  2040. s(0) = "µ"
  2041. s(1) = "σ"
  2042. s(2) = "b"
  2043. s(3) = "<"
  2044. s(4) = "c|"
  2045. s(5) = "δ"
  2046. s(6) = "f"
  2047. s(7) = "9"
  2048. s(8) = "h"
  2049. s(9) = "∩"
  2050. s(10) = "j"
  2051. s(11) = "|<"
  2052. s(12) = "|_"
  2053. s(13) = "/x\"
  2054. s(14) = "|\|"
  2055. s(15) = "0"
  2056. s(16) = "p"
  2057. s(17) = "q"
  2058. s(18) = "r"
  2059. s(19) = "_/»"
  2060. s(20) = "-|-"
  2061. s(21) = "╡"
  2062. s(22) = "\/"
  2063. s(23) = "\/\/"
  2064. s(24) = "╫"
  2065. s(25) = " "
  2066. s(26) = "»/_"
  2067. s(27) = "─"
  2068. s(28) = "▀"
  2069. s(29) = "⌐"
  2070. s(30) = "|}"
  2071. s(31) = "╚"
  2072. s(32) = "F"
  2073. s(33) = "G"
  2074. s(34) = "|-|"
  2075. s(35) = "I"
  2076. s(36) = "J"
  2077. s(37) = "]<"
  2078. s(38) = "]_"
  2079. s(39) = "/\/\"
  2080. s(40) = "|\|"
  2081. s(41) = "{}"
  2082. s(42) = "P"
  2083. s(43) = "╢"
  2084. s(44) = "|2"
  2085. s(45) = "º"
  2086. s(46) = "»|»"
  2087. s(47) = "|_|"
  2088. s(48) = "\/"
  2089. s(49) = "\x/"
  2090. s(50) = "><"
  2091. s(51) = "Ñ"
  2092. s(52) = "»/_"
  2093. text$ = ReplaceC(text$, "a", s(1))
  2094. text$ = ReplaceC(text$, "b", s(2))
  2095. text$ = ReplaceC(text$, "c", s(3))
  2096. text$ = ReplaceC(text$, "d", s(4))
  2097. text$ = ReplaceC(text$, "e", s(5))
  2098. text$ = ReplaceC(text$, "f", s(6))
  2099. text$ = ReplaceC(text$, "g", s(7))
  2100. text$ = ReplaceC(text$, "h", s(8))
  2101. text$ = ReplaceC(text$, "i", s(9))
  2102. text$ = ReplaceC(text$, "j", s(10))
  2103. text$ = ReplaceC(text$, "k", s(11))
  2104. text$ = ReplaceC(text$, "l", s(12))
  2105. text$ = ReplaceC(text$, "m", s(13))
  2106. text$ = ReplaceC(text$, "n", s(14))
  2107. text$ = ReplaceC(text$, "o", s(15))
  2108. text$ = ReplaceC(text$, "p", s(16))
  2109. text$ = ReplaceC(text$, "q", s(17))
  2110. text$ = ReplaceC(text$, "r", s(18))
  2111. text$ = ReplaceC(text$, "s", s(19))
  2112. text$ = ReplaceC(text$, "t", s(20))
  2113. text$ = ReplaceC(text$, "u", s(21))
  2114. text$ = ReplaceC(text$, "v", s(22))
  2115. text$ = ReplaceC(text$, "w", s(23))
  2116. text$ = ReplaceC(text$, "x", s(24))
  2117. text$ = ReplaceC(text$, "y", s(25))
  2118. text$ = ReplaceC(text$, "z", s(26))
  2119. text$ = ReplaceC(text$, "A", s(27))
  2120. text$ = ReplaceC(text$, "B", s(28))
  2121. text$ = ReplaceC(text$, "C", s(29))
  2122. text$ = ReplaceC(text$, "D", s(30))
  2123. text$ = ReplaceC(text$, "E", s(31))
  2124. text$ = ReplaceC(text$, "F", s(32))
  2125. text$ = ReplaceC(text$, "G", s(33))
  2126. text$ = ReplaceC(text$, "H", s(34))
  2127. text$ = ReplaceC(text$, "I", s(35))
  2128. text$ = ReplaceC(text$, "J", s(36))
  2129. text$ = ReplaceC(text$, "K", s(37))
  2130. text$ = ReplaceC(text$, "L", s(38))
  2131. text$ = ReplaceC(text$, "M", s(39))
  2132. text$ = ReplaceC(text$, "N", s(40))
  2133. text$ = ReplaceC(text$, "O", s(41))
  2134. text$ = ReplaceC(text$, "P", s(42))
  2135. text$ = ReplaceC(text$, "Q", s(43))
  2136. text$ = ReplaceC(text$, "R", s(44))
  2137. text$ = ReplaceC(text$, "S", s(45))
  2138. text$ = ReplaceC(text$, "T", s(46))
  2139. text$ = ReplaceC(text$, "U", s(47))
  2140. text$ = ReplaceC(text$, "V", s(48))
  2141. text$ = ReplaceC(text$, "W", s(49))
  2142. text$ = ReplaceC(text$, "X", s(50))
  2143. text$ = ReplaceC(text$, "Y", s(51))
  2144. text$ = ReplaceC(text$, "Z", s(52))
  2145. text$ = ReplaceC(text$, "ae", s(0))
  2146. EliteType = text$
  2147. Exit Function
  2148. error:  MsgBox Err.Description, vbExclamation, "Error"
  2149. End Function
  2150.  
  2151. Function SpaceCharacters(text As String, AmountOfSpaces As Integer)
  2152. 'This will put a space between every character in the text, like this:  C o o l
  2153. On Error GoTo error
  2154. Dim i As Long
  2155. Dim SpaceStr As String
  2156. If AmountOfSpaces > 100 Then
  2157. AmountOfSpaces = 100
  2158. ElseIf AmountOfSpaces < 1 Then
  2159. AmountOfSpaces = 1
  2160. End If
  2161. For i = 1 To AmountOfSpaces
  2162. SpaceStr$ = SpaceStr$ + " "
  2163. Next i
  2164. Dim endstr As String
  2165. For i = 1 To Len(text$)
  2166. endstr$ = endstr$ & Mid$(text$, i, 1) & SpaceStr$
  2167. Next i
  2168. endstr$ = Mid$(endstr$, 1, Len(endstr$) - 1)
  2169. SpaceCharacters = endstr$
  2170. Exit Function
  2171. error:  MsgBox Err.Description, vbExclamation, "Error"
  2172. End Function
  2173.  
  2174. Function DoubleCharacters(text As String, AmountOfExtras As Integer)
  2175. 'This will double every character in the text, like this:  CCooooll
  2176. On Error GoTo error
  2177. Dim i As Long
  2178. Dim i2 As Long
  2179. Dim endstr As String
  2180. If AmountOfExtras > 100 Then
  2181. AmountOfExtras = 100
  2182. ElseIf AmountOfExtras < 1 Then
  2183. AmountOfExtras = 1
  2184. End If
  2185. For i = 1 To Len(text$)
  2186.   For i2 = 1 To AmountOfExtras
  2187.   endstr$ = endstr$ & Mid$(text$, i, 1)
  2188.   Next i2
  2189. Next i
  2190. DoubleCharacters = endstr$
  2191. Exit Function
  2192. error:  MsgBox Err.Description, vbExclamation, "Error"
  2193. End Function
  2194.  
  2195. Function EchoText(text As String, Reverse As Boolean)
  2196. 'This will "echo" the text, like this:  Cool ool ol l
  2197. On Error GoTo error
  2198. Dim i As Long
  2199. Dim endstr As String
  2200. For i = 1 To Len(text$)
  2201.   If Reverse = True Then
  2202.   endstr$ = Mid$(text$, i, Len(text$) - (i - 1)) & " " & endstr$
  2203.   Else
  2204.   endstr$ = endstr$ & Mid$(text$, i, Len(text$) - (i - 1)) & " "
  2205.   End If
  2206. Next i
  2207. endstr$ = Mid$(endstr$, 1, Len(endstr$) - 1)
  2208. EchoText = endstr$
  2209. Exit Function
  2210. error:  MsgBox Err.Description, vbExclamation, "Error"
  2211. End Function
  2212.  
  2213. Function Scramble(text As String, Key As Integer)
  2214. 'This will scramble text up, example:  oCol
  2215. On Error GoTo error
  2216. Dim RndNum As Long
  2217. Dim i As Long
  2218. Dim endstr As String
  2219. Dim ListN(10000) As Long
  2220. Dim CurPos As Long
  2221. Randomize Key
  2222. CurPos = 0
  2223. text$ = Mid$(text$, 1, 10000)
  2224. Start:
  2225. RndNum = Int((Len(text$) - 1 + 1) * Rnd + 1)
  2226. For i = 0 To CurPos
  2227.   If RndNum = ListN(i) Then
  2228.   GoTo Start
  2229.   End If
  2230. Next i
  2231. ListN(CurPos) = RndNum
  2232. CurPos = CurPos + 1
  2233. If Not CurPos = Len(text$) Then
  2234. GoTo Start
  2235. End If
  2236. For i = 0 To CurPos - 1
  2237. endstr$ = endstr$ & Mid$(text$, ListN(i), 1)
  2238. Next i
  2239. Scramble = endstr$
  2240. Exit Function
  2241. error:  MsgBox Err.Description, vbExclamation, "Error"
  2242. End Function
  2243.  
  2244. Function TwistText(text As String)
  2245. 'This will "twist" text, it is kind of like scramble, example:  oClo
  2246. Dim CurPos As Long
  2247. Dim endstr As String
  2248. CurPos = 1
  2249. Start:
  2250. endstr$ = endstr$ & Mid$(text$, CurPos + 1, 1) & Mid$(text$, CurPos, 1)
  2251. CurPos = CurPos + 2
  2252. Graph2 Len(text$), CurPos
  2253. If Len(text$) > CurPos Then
  2254. GoTo Start
  2255. ElseIf Len(text$) = CurPos Then
  2256. endstr$ = endstr$ & Mid$(text$, Len(text$), 1)
  2257. End If
  2258. TwistText = endstr$
  2259. End Function
  2260.  
  2261. 'Section 17:  Current Application Info
  2262.  
  2263. Function GetAppVersion()
  2264. 'This will retrieve the current version of your application
  2265. On Error GoTo error
  2266. AppVersion = App.Major & "." & App.Minor & "." & App.Revision
  2267. Exit Function
  2268. error:  MsgBox Err.Description, vbExclamation, "Error"
  2269. End Function
  2270.  
  2271. Function GetAppName(ShowEXE As Boolean)
  2272. 'This will get the application's .exe name
  2273. On Error GoTo error
  2274. GetAppName = App.EXEName
  2275. If ShowEXE = True Then
  2276. GetAppName = GetAppName & ".exe"
  2277. End If
  2278. Exit Function
  2279. error:  MsgBox Err.Description, vbExclamation, "Error"
  2280. End Function
  2281.  
  2282. Function GetAppPath()
  2283. 'This will get the application's current path
  2284. On Error GoTo error
  2285. GetAppPath = App.Path
  2286. Exit Function
  2287. error:  MsgBox Err.Description, vbExclamation, "Error"
  2288. End Function
  2289.  
  2290. Function GetAppDescription()
  2291. 'This will get the application's file description
  2292. On Error GoTo error
  2293. GetAppDescription = App.FileDescription
  2294. Exit Function
  2295. error:  MsgBox Err.Description, vbExclamation, "Error"
  2296. End Function
  2297.  
  2298. Function GetAppCopyRight()
  2299. 'This will get the application's copyright
  2300. On Error GoTo error
  2301. GetAppCopyRight = App.LegalCopyright
  2302. Exit Function
  2303. error:  MsgBox Err.Description, vbExclamation, "Error"
  2304. End Function
  2305.  
  2306. Function GetAppComment()
  2307. 'This will get the application's comment
  2308. On Error GoTo error
  2309. GetAppComment = App.Comments
  2310. Exit Function
  2311. error:  MsgBox Err.Description, vbExclamation, "Error"
  2312. End Function
  2313.  
  2314. Function GetAppTitle()
  2315. 'This will get the application's title
  2316. On Error GoTo error
  2317. GetAppTitle = App.Title
  2318. Exit Function
  2319. error:  MsgBox Err.Description, vbExclamation, "Error"
  2320. End Function
  2321.  
  2322. Function GetAppCompanyName()
  2323. 'This will get the application's company name
  2324. On Error GoTo error
  2325. GetAppCompanyName = App.CompanyName
  2326. Exit Function
  2327. error:  MsgBox Err.Description, vbExclamation, "Error"
  2328. End Function
  2329.  
  2330. Function GetAppProductName()
  2331. 'This will get the application's product name
  2332. On Error GoTo error
  2333. GetAppProductName = App.ProductName
  2334. Exit Function
  2335. error:  MsgBox Err.Description, vbExclamation, "Error"
  2336. End Function
  2337.  
  2338. 'Section 18:  Mouse Stuff
  2339.  
  2340. Public Sub MoveMouse(X As Integer, Y As Integer)
  2341. 'Move the mouse
  2342. On Error GoTo error
  2343. Mouse.X = CLng(CDbl(X))
  2344. Mouse.Y = CLng(CDbl(Y))
  2345. Exit Sub
  2346. error:  MsgBox Err.Description, vbExclamation, "Error"
  2347. End Sub
  2348.  
  2349. Function MousePosition()
  2350. 'Get the mouse's current position
  2351. On Error GoTo error
  2352. If index = 0 Then
  2353. MousePosition = Mid$(Str$(Mouse.X), 2, Len(Str$(Mouse.X)) - 1)
  2354. MousePosition = MousePosition + "," + Str$(Mouse.Y)
  2355. End If
  2356. Exit Function
  2357. error:  MsgBox Err.Description, vbExclamation, "Error"
  2358. End Function
  2359.  
  2360. Public Sub LeftClick()
  2361. 'Mouse left click
  2362. On Error GoTo error
  2363. LeftDown
  2364. LeftUp
  2365. Exit Sub
  2366. error:  MsgBox Err.Description, vbExclamation, "Error"
  2367. End Sub
  2368.  
  2369. Public Sub LeftDown()
  2370. 'Mouse left down
  2371. On Error GoTo error
  2372. mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
  2373. Exit Sub
  2374. error:  MsgBox Err.Description, vbExclamation, "Error"
  2375. End Sub
  2376.  
  2377. Public Sub LeftUp()
  2378. 'Mouse left up
  2379. On Error GoTo error
  2380. mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
  2381. Exit Sub
  2382. error:  MsgBox Err.Description, vbExclamation, "Error"
  2383. End Sub
  2384.  
  2385. Public Sub MiddleClick()
  2386. 'Mouse middle click
  2387. On Error GoTo error
  2388. MiddleDown
  2389. MiddleUp
  2390. Exit Sub
  2391. error:  MsgBox Err.Description, vbExclamation, "Error"
  2392. End Sub
  2393.  
  2394. Public Sub MiddleDown()
  2395. 'Mouse middle down
  2396. On Error GoTo error
  2397. mouse_event MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0
  2398. Exit Sub
  2399. error:  MsgBox Err.Description, vbExclamation, "Error"
  2400. End Sub
  2401.  
  2402. Public Sub MiddleUp()
  2403. 'Mouse middle up
  2404. On Error GoTo error
  2405. mouse_event MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0
  2406. Exit Sub
  2407. error:  MsgBox Err.Description, vbExclamation, "Error"
  2408. End Sub
  2409.  
  2410. Public Sub RightClick()
  2411. 'Mouse right click
  2412. On Error GoTo error
  2413. RightDown
  2414. RightUp
  2415. Exit Sub
  2416. error:  MsgBox Err.Description, vbExclamation, "Error"
  2417. End Sub
  2418.  
  2419. Public Sub RightDown()
  2420. 'Mouse right down
  2421. On Error GoTo error
  2422. mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0
  2423. Exit Sub
  2424. error:  MsgBox Err.Description, vbExclamation, "Error"
  2425. End Sub
  2426.  
  2427. Public Sub RightUp()
  2428. 'Mouse right up
  2429. On Error GoTo error
  2430. mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
  2431. Exit Sub
  2432. error:  MsgBox Err.Description, vbExclamation, "Error"
  2433. End Sub
  2434.  
  2435. Public Sub HideMouse()
  2436. 'Hide mouse cursor
  2437. On Error GoTo error
  2438. ShowCursor (bShow = False)
  2439. Exit Sub
  2440. error:  MsgBox Err.Description, vbExclamation, "Error"
  2441. End Sub
  2442.  
  2443. Public Sub ShowMouse()
  2444. 'Show mouse cursor
  2445. On Error GoTo error
  2446. ShowCursor (bShow = True)
  2447. Exit Sub
  2448. error:  MsgBox Err.Description, vbExclamation, "Error"
  2449. End Sub
  2450.  
  2451. 'Section 19:  Draw
  2452.  
  2453. Public Sub DrawSquareOnForm(frm As Form, X1 As Single, X2 As Single, Y1 As Single, Y2 As Single, Red As Integer, Green As Integer, Blue As Integer, Solid As Boolean)
  2454. 'This will draw a square on a form
  2455. On Error GoTo error
  2456. If Solid = True Then
  2457. frm.Line (X1, Y1)-(X2, Y2), RGB(Red, Green, Blue), BF
  2458. Else
  2459. frm.Line (X1, Y1)-(X2, Y2), RGB(Red, Green, Blue), B
  2460. End If
  2461. Exit Sub
  2462. error:  MsgBox Err.Description, vbExclamation, "Error"
  2463. End Sub
  2464.  
  2465. Public Sub DrawLineOnForm(frm As Form, X1 As Single, X2 As Single, Y1 As Single, Y2 As Single, Red As Integer, Green As Integer, Blue As Integer)
  2466. 'This will draw a line on a form
  2467. On Error GoTo error
  2468. frm.Line (X1, Y1)-(X2, Y2), RGB(Red, Green, Blue)
  2469. Exit Sub
  2470. error:  MsgBox Err.Description, vbExclamation, "Error"
  2471. End Sub
  2472.  
  2473. Public Sub DrawSquareOnPictureBox(Picture As PictureBox, X1 As Single, X2 As Single, Y1 As Single, Y2 As Single, Red As Integer, Green As Integer, Blue As Integer, Solid As Boolean)
  2474. 'This will draw a square on a form
  2475. On Error GoTo error
  2476. If Solid = True Then
  2477. Picture.Line (X1, Y1)-(X2, Y2), RGB(Red, Green, Blue), BF
  2478. Else
  2479. Picture.Line (X1, Y1)-(X2, Y2), RGB(Red, Green, Blue), B
  2480. End If
  2481. Exit Sub
  2482. error:  MsgBox Err.Description, vbExclamation, "Error"
  2483. End Sub
  2484.  
  2485. Public Sub DrawLineOnPictureBox(Picture As PictureBox, X1 As Single, X2 As Single, Y1 As Single, Y2 As Single, Red As Integer, Green As Integer, Blue As Integer)
  2486. 'This will draw a line on a form
  2487. On Error GoTo error
  2488. Picture.Line (X1, Y1)-(X2, Y2), RGB(Red, Green, Blue)
  2489. Exit Sub
  2490. error:  MsgBox Err.Description, vbExclamation, "Error"
  2491. End Sub
  2492.  
  2493. 'Section 20:  Misc
  2494.  
  2495. Function ConvertRGBToHex(Red As Double, Green As Double, Blue As Double)
  2496. 'Convert RGB color coding to Hexidecimal color coding
  2497. On Error GoTo error
  2498. ConvertRGBToHex = RGBToHex(RGB(Blue, Green, Red))
  2499. Exit Function
  2500. error:  MsgBox Err.Description, vbExclamation, "Error"
  2501. End Function
  2502.  
  2503. Private Function RGBToHex(RGB)
  2504. 'For Convert RGB to Hexidecimal (and HTML fader):  Converts RGB to Hexidecimal
  2505. On Error GoTo error
  2506. Dim a As String
  2507. Dim B As Integer
  2508. a$ = Hex(RGB)
  2509.     B% = Len(a$)
  2510.     If B% = 5 Then a$ = "0" & a$
  2511.     If B% = 4 Then a$ = "00" & a$
  2512.     If B% = 3 Then a$ = "000" & a$
  2513.     If B% = 2 Then a$ = "0000" & a$
  2514.     If B% = 1 Then a$ = "00000" & a$
  2515.     RGBToHex = a$
  2516. Exit Function
  2517. error:  MsgBox Err.Description, vbExclamation, "Error"
  2518. End Function
  2519.  
  2520. Function ConvertHexToRGB(HexCode As String)
  2521. 'This will convert Hexidecimal color coding to RGB color coding
  2522. On Error GoTo error
  2523. HexCode$ = Mid$(HexCode$, 1, 6)
  2524. ConvertHexToRGB = HexToRGB(HexCode$)
  2525. Exit Function
  2526. error:  MsgBox Err.Description, vbExclamation, "Error"
  2527. End Function
  2528.  
  2529. Private Function HexToRGB(H As String) As Currency
  2530. 'For Convert Hexidecimal to RGB:  Converts Hexidecimal to RGB
  2531. On Error GoTo error
  2532. Dim Tmp$
  2533. Dim lo1 As Integer, lo2 As Integer
  2534. Dim hi1 As Long, hi2 As Long
  2535. Const Hx = "&H"
  2536. Const BigShift = 65536
  2537. Const LilShift = 256, Two = 2
  2538. Tmp = H
  2539. If UCase(Left$(H, 2)) = "&H" Then Tmp = Mid$(H, 3)
  2540. Tmp = Right$("0000000" & Tmp, 8)
  2541. If IsNumeric(Hx & Tmp) Then
  2542. lo1 = CInt(Hx & Right$(Tmp, Two))
  2543. hi1 = CLng(Hx & Mid$(Tmp, 5, Two))
  2544. lo2 = CInt(Hx & Mid$(Tmp, 3, Two))
  2545. hi2 = CLng(Hx & Left$(Tmp, Two))
  2546. HexToRGB = CCur(hi2 * LilShift + lo2) * BigShift + (hi1 * LilShift) + lo1
  2547. End If
  2548. Exit Function
  2549. error:  MsgBox Err.Description, vbExclamation, "Error"
  2550. End Function
  2551.  
  2552. Public Sub WebPage(Address As String)
  2553. 'Open a webpage in the default browser
  2554. On Error GoTo error
  2555. ret = Shell("Start.exe " & Address, 0)
  2556. Exit Sub
  2557. error:  MsgBox Err.Description, vbExclamation, "Error"
  2558. End Sub
  2559.  
  2560. Function RandomNumber(Max As Double, Min As Double)
  2561. 'Create a random number
  2562. On Error GoTo error
  2563. Randomize Timer
  2564. RandomNumber = Int((Max - Min + 1) * Rnd + Min)
  2565. Exit Function
  2566. error:  MsgBox Err.Description, vbExclamation, "Error"
  2567. End Function
  2568.  
  2569. Function MakeInputBox(DefaultText As String, Question As String, Title As String)
  2570. 'This creates an input box
  2571. On Error GoTo error
  2572. MakeInputBox = InputBox(Question$, Title$, DefaultText$)
  2573. Exit Function
  2574. error:  MsgBox Err.Description, vbExclamation, "Error"
  2575. End Function
  2576.  
  2577. Function LengthOfString(text As String) As Long
  2578. 'This will tell you how many characters are in a string
  2579. On Error GoTo error
  2580. LengthOfString = Len(text$)
  2581. Exit Function
  2582. error:  MsgBox Err.Description, vbExclamation, "Error"
  2583. End Function
  2584.  
  2585. Function FindAsciiOfChr(Chr As String)
  2586. 'This will tell you the ascii of ONE CHARACTER (first one in the string)
  2587. On Error GoTo error
  2588. FindAsciiOfChr = Asc(Mid$(Chr$, 1, 1))
  2589. Exit Function
  2590. error:  MsgBox Err.Description, vbExclamation, "Error"
  2591. End Function
  2592.  
  2593. Function MakeChrFromAscii(Ascii As Integer)
  2594. 'This will make a character out of ascii
  2595. On Error GoTo error
  2596. MakeChrFromAscii = Chr$(Ascii)
  2597. Exit Function
  2598. error:  MsgBox Err.Description, vbExclamation, "Error"
  2599. End Function
  2600.  
  2601. Function MakeRndChrString(Length As Integer, Numbers As Boolean, Letters As Boolean, Symbols As Boolean, other As Boolean) As String
  2602. 'This will make a random string (good for passwords)
  2603. On Error GoTo error
  2604. Dim ChrAsc As Integer
  2605. Dim i As Integer
  2606. Dim endstr As String
  2607. Randomize Timer
  2608. If Length > 100 Then
  2609. Length = 100
  2610. ElseIf Length < 1 Then
  2611. Length = 1
  2612. End If
  2613. For i = 1 To Length
  2614. Start:
  2615. ChrAsc = Int((255 - 1 + 1) * Rnd + 1)
  2616.   If ChrAsc < 34 Then
  2617.     If other = False Then
  2618.     GoTo Start
  2619.     End If
  2620.   ElseIf ChrAsc > 33 And ChrAsc < 49 Then
  2621.     If Symbols = False Then
  2622.     GoTo Start
  2623.     End If
  2624.   ElseIf ChrAsc > 48 And ChrAsc < 58 Then
  2625.     If Numbers = False Then
  2626.     GoTo Start
  2627.     End If
  2628.   ElseIf ChrAsc > 57 And ChrAsc < 65 Then
  2629.     If Symbols = False Then
  2630.     GoTo Start
  2631.     End If
  2632.   ElseIf ChrAsc > 64 And ChrAsc < 91 Then
  2633.     If Letters = False Then
  2634.     GoTo Start
  2635.     End If
  2636.   ElseIf ChrAsc > 90 And ChrAsc < 97 Then
  2637.     If Symbols = False Then
  2638.     GoTo Start
  2639.     End If
  2640.   ElseIf ChrAsc > 96 And ChrAsc < 123 Then
  2641.     If Letters = False Then
  2642.     GoTo Start
  2643.     End If
  2644.   ElseIf ChrAsc > 122 And ChrAsc < 127 Then
  2645.     If Symbols = False Then
  2646.     GoTo Start
  2647.     End If
  2648.   Else
  2649.     If other = False Then
  2650.     GoTo Start
  2651.     End If
  2652.   End If
  2653. endstr$ = endstr$ & Chr$(ChrAsc)
  2654. Next i
  2655. MakeRndChrString = endstr$
  2656. Exit Function
  2657. error:  MsgBox Err.Description, vbExclamation, "Error"
  2658. End Function
  2659.  
  2660. Public Sub DoSendKeys(AppToActivate As String, AppActivateDelay As Integer, TextToSend As String, SendKeysDelay As Integer)
  2661. 'This will use SendKeys to send text to an outside application
  2662. On Error GoTo error
  2663. AppActivate AppToActivate$, AppActivateDelay
  2664. SendKeys TextToSend$, SendKeysDelay
  2665. Exit Sub
  2666. error:  MsgBox Err.Description, vbExclamation, "Error"
  2667. End Sub
  2668.  
  2669. Function GetTextFromListBox(ListB As ListBox, ListIndex As Long) As String
  2670. 'This will get text from a listbox
  2671. On Error GoTo error
  2672. GetTextFromListBox = ListB.List(ListIndex)
  2673. Exit Function
  2674. error:  MsgBox Err.Description, vbExclamation, "Error"
  2675. End Function
  2676.  
  2677. Function GetTextFromComboBox(ComboB As ComboBox, ListIndex As Long) As String
  2678. 'This will get text from a combobox
  2679. On Error GoTo error
  2680. GetTextFromComboBox = ComboB.List(ListIndex)
  2681. Exit Function
  2682. error:  MsgBox Err.Description, vbExclamation, "Error"
  2683. End Function
  2684.  
  2685. Function PasswordLock(password As String)
  2686. 'This will create an input box to create a simple password protection
  2687. On Error GoTo error
  2688. Dim xtra As String
  2689. Start:
  2690. xtra$ = InputBox("Please enter the password.", "Password Lock")
  2691. If xtra$ = password$ Then
  2692. MsgBox "Correct Password!", vbExclamation, "Password Lock"
  2693. Else
  2694.   If MsgBox("Incorrect Password!  Would you like to try again?", 48 + vbYesNo, "Password Lock") = vbYes Then
  2695.   GoTo Start
  2696.   Else
  2697.   End
  2698.   End If
  2699. End If
  2700. Exit Function
  2701. error:  MsgBox Err.Description, vbExclamation, "Error"
  2702. End Function
  2703.  
  2704. Public Sub ChangeDefaultDir(NewDirPath As String)
  2705. 'This will change the default directory on a computer
  2706. On Error GoTo error
  2707. ChDir NewDirPath$
  2708. Exit Sub
  2709. error:  MsgBox Err.Description, vbExclamation, "Error"
  2710. End Sub
  2711.  
  2712. Public Sub ChangeDefaultDrive(NewDrive As String)
  2713. 'This will change the default drive on a computer
  2714. On Error GoTo error
  2715. ChDrive NewDrive$
  2716. Exit Sub
  2717. error:  MsgBox Err.Description, vbExclamation, "Error"
  2718. End Sub
  2719.  
  2720. Public Sub MakeRegistrySetting(RegPath As String, Title As String, Data As String)
  2721. 'This will make a registry setting
  2722. On Error GoTo error
  2723. a = MakeRegFile(&H80000002, RegPath$, Title$, Data$)
  2724. Exit Sub
  2725. error:  MsgBox Err.Description, vbExclamation, "Error"
  2726. End Sub
  2727.